Version 0.1 - 2 March 2012
Example of setting the GoMap.Az was described in last tutorial (opens in new window).
In this tutorial considered mechanism detecting address by coordinates on the map using GoMap API. Ready example be here (opens in new window).
To use additional services GoMap.Az, you need to add javascript file:
<script src="http://maps.gomap.az/api/js/services.1.0.js"></script>
1) To use the API function is called
Az.GoMap.Service.RGeo(longitude, latitude, zoom, lng, callback) .
Function parameters:
longitude, latitude – point coordinates
zoom – map scale (interval from 1 to 18)
lng - language (az, en, ru)
callback – In the derivation of the results, this function is called, the first parameter which can get the address of the point.
In the example, the function checks the operation with these arguments:
Az.GoMap.Service.RGeo(lonlatD.lon, lonlatD.lat, map.getZoom(), "ru", function(address) {
document.getElementById("info").innerHTML = address;
});2) Take advantage of this service can also, with the help of a request for an address maps.gomap.az/api.do.
Request is formed by as follows:
http://maps.gomap.az/info/api.do?cm=rgeo&cx=49.833963210198&cy=40.373491130916&cz=16&lng=ru Здесь,
cm - Name of the command. Our request will be rgeo.
cx, cy - Coordinates of the point, which is determined to address
cz - scale
lng - language (az, en, ru)
In response to a request output point address. It may be a street name, house number or just the street name.