getExtent()

Method
getExtent()

Scope
F1.Maker.Map

Required Arguements: (none)

Optional Arguments: (none)

Returns:

{ west: float,
  south: float,
  east: float,
  north: float,
  northWest: {lat: float, lon: float},
  southEast: {lat: float, lon: float}
}

Example


Code

var sample_map = new F1.Maker.Map({
  	  map_id: 81930, 
  	  dom_id: "geocommons_map", 
  	  uiZoom: true,
  	  uiLayers: false,
  	  uiLegend: false,
      onmaploaded: function () { updateExtent() },
      onmappanned: function() { updateExtent() }
  	});
function updateExtent() { var extent = sample_map.getExtent(); 
  document.getElementById('results').innerHTML = "[" + extent.west + ", " + extent.south + ", " + extent.east + ", " + extent.north +"]" };

Returns
[Object northWest=[Object lat=39.52367858860299 lon=-77.90582198404641] southEast=[Object lat=39.37627930774779 lon=-77.49417801595357] east=-77.49417801595357 west=-77.90582198404641 north=39.52367858860299 south=39.37627930774779]

setExtent()

Method
setExtent(west, south, east, north)

Scope
F1.Maker.Map

Required Arguments:

ArgumentDescriptionExample
westlongitude furthest west of extent-77.3783
southlatitude furthest south of extent12.1002
eastlongitude furthest east of extent139.3535
northlatitude furthest north of extent39.2422

Set extent passes a bounding box in WSEN order as either a string,array or separate arguments

Optional Arguments: (none)

Returns: (none)

Examples:

mymap.setExtent(-80, 35, -75, 40);
mymap.setExtent("-80, 35, -75, 40");
mymap.setExtent([-80, 35, -75, 40]);

getCenterZoom()

Method
getCenterZoom()

Scope
F1.Maker.Map

Example

var zoom = mymap.getCenterZoom();

Returns:

Returns: {lat, lon, zoom}

[Object lon=-77.08585 lat=38.891142999999985, 15]

setCenter()

Method
setCenter(latitude, longitude)

Scope
F1.Maker.Map

Required Arguements:

ArgumentDescriptionExample
latitudethe latitude of the center point of the map39.999
longitudethe longitude of the center point of the map-73.333

Optional Arguments: (none)

Returns: (none)

Example

mymap.setCenter(38.891143, -77.08585);

setCenterZoom()

Method
setCenterZoom(latitude, longitude, zoom)

Scope
F1.Maker.Map

Required Arguements:

ArgumentDescriptionExample
latitudethe latitude of the center point of the map39.999
longitudethe longitude of the center point of the map-73.333
zoomthe zoom level of the map furthest zoom out is 1, most maps go to zoom level 1815

Optional Arguments: (none)

Returns: (none)

Example:

mymap.setCenterZoom(38.891143, -77.08585, 15);

getZoom()

Method
getZoom()

Scope
F1.Maker.Map

Required Arguements: (none)

Optional Arguments: (none)

Returns: (none)

var zoomLevel = mymap.getZoom(); // 10

Example

mymap.getZoom();

setZoom()

Method
setZoom(zoomLevel)

Scope
F1.Maker.Map

Required Arguements:

ArgumentDescriptionExample
zoomLevelthe zoom level of the map, maps are zoom level 1 when they are zoomed all the way out12

Optional Arguments: (none)

Returns: (none)

Example

mymap.setZoom(10);
 

Comments are closed.