Leaflet Geo Manager

Manage layers, identifiers and geocoders

Manage baselayers:

  • OpenStreetMap Default
  • Google
  • Google Satellite
  • Google Hybrid
  • Google Terrain
  • Bing
  • Bing Aerial
  • Bing Hybrid
  • OpenStreetMap Black and White
  • OpenCycleMap default
  • OpenCycleMap Transport
  • OpenCycleMap Landscape
  • MapQuest
  • MapQuest Aerial
  • Stamen Toner
  • Stamen Terrain
  • Stamen Watercolor
  • ESRI
  • ESRI WorldTopoMap
  • ESRI WorldImagery
  • Yandex
  • Yandex Satellite
  • Yandex Hybrid
  • Yandex Public Map
  • Yandex Public Hybrid
  • Wikimapia OSM

Manage overlays:

  • Wikimapia Hybrid
  • Russian cadastre
  • Ukrainian cadastre

Manage interactive layers and identifiers:

  • Wikimapia API
  • OSM Identify
  • Google Identify
  • Bing Identify
  • Russian cadastre
  • Ukrainian cadastre

Manage geocoders:

  • OpenStreetMap
  • Google
  • Bing
  • ESRI
  • Geonames
  • MapQuest
  • Nokia
  • Yandex
  • RUCadastre (parcel numbers)
  • UACadastre (parcel numbers)

Add script

// GEO Ip Locator Script
<script src="http://j.maxmind.com/app/geoip.js"></script>
// Date.format using by some identifiers
<script src="components/date.format/date.format.js"></script>
// jQuery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
// Select2
<script src="components/jquery.select2/select2.js"></script>
// Leaflet
<script src="http://cdn.leafletjs.com/leaflet-0.5.1/leaflet.js"></script>
// Leaflet.label
<script src="components/leaflet.label/leaflet.label-src.js"></script>
// Leaflet.GeoManager
<script src="components/leaflet.geomanager/layers/google.js"></script>
<script src="components/leaflet.geomanager/layers/bing.js"></script>
<script src="components/leaflet.geomanager/layers/wikimapia.js"></script>
<script src="components/leaflet.geomanager/leaflet.geomanager.js"></script>
// Optional Yandex providers
<script src="components/leaflet.geomanager/layers/yandex.js"></script>
<script src="components/leaflet.geomanager/providers/yandex.js"></script>
// Optional Cadastre providers
<script src="components/leaflet.geomanager/layers/rucadastre.js"></script>
<script src="components/leaflet.geomanager/providers/cadastre.js"></script>

<script>
  var map = L.map('map').setView([geoip_latitude(),  geoip_longitude()], 13);

  L.control.scale().addTo(map);

  var geoManager = new L.GeoManager({
    apikeys: {
      'bing': ''
      , 'mapquest': ''
      , 'wikimapia': ''
      , 'nokia': ''
    }
  });

  geoManager.addTo(map);

  // Change baselayer
  $('#google').on('click', function (e) {
    geoManager.setOptions({baselayer: 'google'});
  })
  // Change overlay
  $('#overlay').on('click', function (e) {
    geoManager.setOptions({overlay: 'wikimapia-hybrid'});
  })
  // Change interactive layer
  $('#interactivelayer').on('click', function (e) {
    geoManager.setOptions({interactivelayer: 'wikimapia-api'});
  })
  // Geocode on click or keydown
  $('#geocodebutton').on('click', function(e) {
      geoManager.geocode( $('#geocodeinput').val())
  });

  $('#geocodeinput').on('keydown', function(e) {
    if (e.keyCode == 13 ) {
      e.preventDefault();
      geoManager.geocode( $('#geocodeinput').val())
    }
  });


</script>
Name type description
apikey object Hash with apikeys {'bing':'', ...}
providers object Hash with named providers and functions {provider_name: function () {}, ...}
baselayer string Name of current baselayer provider
overlay string Name of current overlay provider
interactivelayer string Name of current interactive layer provider
geocoder string Name of current geocoder
Name argument type description
geocode string Geocode