I recall having this problem too. By setting autoNavigate to false, I was able to get the map to refresh properly. I also set the zoom scale to 17.Hope you are staying dry out there in CO.
var myGeocoders = [ { url: "http://ndis-flex.nrel.colostate.edu/ArcGIS/rest/services/AddressLocator_All2/GeocodeServer", name: "AddressLocator_All2", placeholder: "Search for a Colorado Place...", minCharacters: 8, singleLineFieldName: "PlaceName", outFields: ["*"] }]; geocoder = new esri.dijit.Geocoder({ autoNavigate: true, // do not zoom to best result autoComplete: true, showResults: true, // when true, suggestions are displayed as the user is typing maxLocations: 20, map: map, arcgisGeocoder: false, geocoders: myGeocoders }, "search"); geocoder.startup(); // When geocoding is complete. this is also run when you highlight the typed in text to erase it. geocoder.on("select", function(results) { if (results.result) map.centerAndZoom(results.result.feature.geometry, 11); //map.setExtent(esri.geometry.getExtentForScale(map, "144448")); //map.setScale(144448); });
var gc = [{ url: "http://MyServer/arcgis/rest/services/MyGeocoder/GeocodeServer", name: "Geocoder", singleLineFieldName: "Street" }]; var geocoder = new esri.dijit.Geocoder({ map: map, autoNavigate: false, autoComplete: true, geocoders: gc, geocoderMenu: false, arcgisGeocoder: false, placeholder: "142 East Main St" }, "search"); geocoder.startup(); geocoder.on("find-results", showResults);
function showResults(results) { var geom; for (var i = 0; i < results.results.results.length; i++) { console.debug(results.results.results, " at index ", i); geom = results.results.results[0].feature.geometry; } map.centerAndZoom(geom, 20); geocoder.inputNode.blur(); }
geom = results.results.results[0].feature.geometry;
map.centerAndZoom(geom, 20);
var gc = [{ url: "http://MyURL/arcgis/rest/services/myGeocoder/GeocoderServer", name: "theGeocoder", singleLineFieldName: "Street" }]; var geocoder = new esri.dijit.Geocoder({ map: map, autoNavigate: true, autoComplete: true, geocoders: gc, geocoderMenu: false, arcgisGeocoder: false, placeholder: "142 East Main St" }, "search"); geocoder.startup();
geocoder = new esri.dijit.Geocoder({ map: map, autocomplete: true, placehoder: "Find a place", //searchExtent: search_extent, arcgisGeocoder: { name: "Esri World Geocoder" } }, "search"); geocoder.startup();
"Street": dom.byId("address").value
var myGeocoders = [{ url: locatorUrl, name: "Meriden", //if your locator uses a single line input field name other than 'Single Line Input', //tell the widget how to make the appropriate request singleLineFieldName: "Street" }]; geocoder = new Geocoder({ map: map, autocomplete: true, arcgisGeocoder: false, geocoders: myGeocoders, value: "Main St." },"search");
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.