locator = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); locator.on("address-to-locations-complete", showResults); //locatorReverse = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"); locator.on("location-to-address-complete", function(evt) { if (evt.address.address) { var address = evt.address.address; var location = webMercatorUtils.geographicToWebMercator(evt.address.location); } }); map.on("click", function(evt) { locator.locationToAddress(webMercatorUtils.webMercatorToGeographic(evt.mapPoint), 100); }); // listen for Locate button click then geocode registry.byId("locate").on("click", locate);
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.