Creating a Simple Map
The MapLarge Javascript API is a client side library used to create maps and layers. It interacts with the MapLarge web services that are drop in compatible with Google Maps, Leaflet, ESRI and other mapping API's.
To use the MapLarge Javascript API, add the following script tag at the top of your HTML page in the header section:
<script type="text/javascript" src="//e.maplarge.com/JS"></script>
Note: If directed to a specific MapLarge server, specify it in the URL.
There are three main steps for displaying a map on a web page:
1. Create a map container and attach it to the page DOM
2. Create a map instance within the div
3. Create and display map layers.
Example with Editable Source Code
<html> <head> <script type="text/javascript"> ml.onload(function() { //create a map zoomed in on Atlanta, GA (34,-84) //the second parameter is a Object literal var map = new ml.map('mapDiv', { lat: 33.709, lng: -84.404, z: 9 }); //add a layer with no style: default is "red dots" var layer = new ml.layer(map, { query: { table: 'hms/hotels', //table name = hotels select: 'geo.dot' //geography = dots }, }); //show the layer layer.show(); }); </script> </head> <body> </body>