Toggle navigation
Navmii livemap API beta
Geocoder
Geocoding example 1
Geocoding example 2
Reverse geocoding example 1
Reverse geocoding example 2
Routing
Example 1
Example 2
Example 3
Search
Example 1
Example 2
Reverse geocoding example 2
jsfiddle
Script
Map
Json
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Start
var service = new navmii.maps.Geocoder(); var request = { location: new navmii.maps.LatLng(49.26588, 4.039889) }; wait(1); showMapTab(); service.geocode(request, function (response, status) { if (status === navmii.maps.GeocoderStatus.OK) { showText(JSON.stringify(response, null, ' ')); showResult(response); } else { showJsonTab(); showResult(null); showText('Error: ' + navmii.maps.GeocoderStatus[status] + "\n" + JSON.stringify(response, null, ' ')); } wait(0); }); function showResult(d) { var map = new navmii.maps.Map(document.getElementById('map'), { zoomControl: true }); var fgr = new navmii.maps.FeatureGroup().addTo(map); var br = '<' + 'br>', bs = '<' + 'b>', be = '<' + '/b>'; for (var i = 0, len = d.items.length; i < len; i++) { var item = d.items[i]; var opt = { position: new navmii.maps.LatLng(item.lat, item.lng) }; var marker = new navmii.maps.Marker(opt); fgr.addLayer(marker); var text = bs + 'name: ' + be + item.adminPath + br + bs + 'location: ' + be + item.lat.toFixed(5) + ',' + item.lng.toFixed(5); marker.bindPopup(text); } map.fitBounds(fgr.getBounds()); }