This is an example of a single layer dot map. Debug is turned on to show outputs and enable clicking on the layer dots.  The ChainID column in the table is displayed onhover. layer.show() is called to show the layer on top of the map.

Note: ml.onload is used to ensure the MapLarge API is properly loaded in the DOM. Wrap the MapLarge API in ml.onload() to ensure availability of all functions and methods. If using jQuery this can be a replacement for document.ready
Sample 1: Single Layer Dot Map
  1. <html>
  2. <head>
  3. <script type="text/javascript" src="/JS"></script>
  4. <script type="text/javascript">
  5. ml.onload(function() {
  6.  
  7. //create a map zoomed in on Atlanta, GA (34,-84)
  8. //the second parameter is a Object literal
  9. var map = new ml.map('mapDiv', { lat: 34, lng: -84, z: 9 });
  10.  
  11. //add a layer with no style: default is "red dots"
  12. var layer = new ml.layer(map,
  13. {
  14. query: {
  15. table: 'hms/hotels', //table name = hotels
  16. select: 'geo.dot' //geography = dots
  17. },
  18. onClick: 'debug', //show debug output when dots are clicked
  19. //this function runs when the mouse cursor moves over a layer object
  20. onHover: function (data, layer) {
  21. return data.data.ChainID;
  22. },
  23. //NOTE--> for hover you must list the fields you want to use
  24. hoverFields: ['ChainID']
  25. });
  26.  
  27. //show the layer
  28. layer.show();
  29.  
  30. });
  31. </script>
  32. </head>
  33. <body>
  34. <div id='mapDiv'>
  35. </div>
  36. </body>
  37. </html>