WorldMap.js Orthgraphic and Zoom example and code

The following code is an example map with the Orthographic projection, a custom style and a custom zoom. Zoom out of the projection to see the globe. Check all the available projections bellow.


 <div id="mapcontainer" align="center"> <!-- You can place the container wherever you want, but it has to be before loading the code-->
<link rel="stylesheet" href="css/worldmap.v1.css"> 
<script src="js/worldmap.v1.js"></script>
<script>


   var createmap = new Worldmap({  
    elementid: "#mapcontainer",
     mapstyle: {   // Change the map style
       ocean: "#ffffff"},
    project: {  
        name: "Orthographic",
        zoomlevel: 5, // If you want it to zoom into an area
        zoomarea:[-122.417, 37.775] 
                           },
    showtable:false, // Hide Table
    editpanel:false,  // Hide Edit
   
   defaultfill: "steelblue", // default fill color
 
   defaultsize: 30
   }); 
  
            

Available projections


    var projectionnames={
 "Aitoff": d3.geo.aitoff(),
  "Boggs Eumorphic": d3.geo.boggs(),
  "Craster Parabolic (Putnins P4)": d3.geo.craster(),
  "Cylindrical Equal-Area": d3.geo.cylindricalEqualArea(),
  "Eckert I": d3.geo.eckert1(),
  "Eckert III": d3.geo.eckert3(),
  "Eckert IV": d3.geo.eckert4(),
  "Eckert V": d3.geo.eckert5(),
  "Equidistant Cylindrical (Plate Carrée)": d3.geo.equirectangular(),
  "Fahey": d3.geo.fahey(),
  "Foucaut Sinusoidal": d3.geo.foucaut(),
  "Gall (Gall Stereographic)": d3.geo.cylindricalStereographic(),
  "Ginzburg VIII (TsNIIGAiK 1944)": d3.geo.ginzburg8(),
  "Kavraisky VII": d3.geo.kavrayskiy7(),
  "Larrivée": d3.geo.larrivee(),
  "McBryde-Thomas Flat-Pole Sine (No. 2)": d3.geo.mtFlatPolarSinusoidal(),
  "Mercator": d3.geo.mercator(),
  "Miller Cylindrical I": d3.geo.miller(),
  "Mollweide": d3.geo.mollweide(),
  "Natural Earth": d3.geo.naturalEarth(),
  "Nell-Hammer": d3.geo.nellHammer(),
  "Robinson": d3.geo.robinson(),
  "Sinusoidal": d3.geo.sinusoidal(),
  "van der Grinten (I)": d3.geo.vanDerGrinten(),
  "Wagner VI": d3.geo.wagner6(),
  "Wagner VII": d3.geo.wagner7(),
  "Winkel Tripel": d3.geo.winkel3(),
  "Orthographic": d3.geo.orthographic() 
    
}