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:
| Argument | Description | Example |
|---|---|---|
| west | longitude furthest west of extent | -77.3783 |
| south | latitude furthest south of extent | 12.1002 |
| east | longitude furthest east of extent | 139.3535 |
| north | latitude furthest north of extent | 39.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:
| Argument | Description | Example |
|---|---|---|
| latitude | the latitude of the center point of the map | 39.999 |
| longitude | the 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:
| Argument | Description | Example |
|---|---|---|
| latitude | the latitude of the center point of the map | 39.999 |
| longitude | the longitude of the center point of the map | -73.333 |
| zoom | the zoom level of the map furthest zoom out is 1, most maps go to zoom level 18 | 15 |
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:
| Argument | Description | Example |
|---|---|---|
| zoomLevel | the zoom level of the map, maps are zoom level 1 when they are zoomed all the way out | 12 |
Optional Arguments: (none)
Returns: (none)
Example
mymap.setZoom(10);
GeoIQ Blog- TechCamp April 30, 2012 Andrew Turner
- Visualizing our Changing Climate with Climascope April 27, 2012 Andrew Turner
- World Bank Annual Meetings April 23, 2012 Andrew Turner
- Just in Time Analytics – Kanban for Big Data April 5, 2012 Sean Gorman
- GeoIQ team at Where2.0, JSConf, FOSS4G-NA March 22, 2012 Andrew Turner
