Select to view content in your preferred language

Map Service disappears from map after query is run and then map is moved

1249
4
01-18-2012 12:16 PM
GarethMann
Deactivated User
I am working on a simple page to query a data layer and zoom to it:

http://northmiamicra.org/SearchAddress.html

Once you hit find address, the map will zoom to the location and display the queried parcel in grey. That works fine (to test it simply use the default parameters in the boxes).

However once that is done and then the user tries to pan around on the map or zoom in and out, the background map service disappears. Why is this?

On another unrelated question, why am I not seeing the standard zoom slider tool in my map? Instead I am getting some tiny "+" and "-" signs in the top-left corner that are barely visible. How do I specify to show the proper zoom slider that users will be familiar with? I have already specified "map.isZoomSlider = true".
0 Kudos
4 Replies
derekswingley1
Deactivated User

However once that is done and then the user tries to pan around on the map or zoom in and out, the background map service disappears. Why is this?

Your map service is in State Plane but you're specifying your map's initial extent in web mercator. This doesn't show up as a problem until after you set the map's extent with a geometry that has a different wkid. To fix this, specify your startExtent as something with wkid 2236. Or just leave out start extent since it's not currently doing anything.


On another unrelated question, why am I not seeing the standard zoom slider tool in my map? Instead I am getting some tiny "+" and "-" signs in the top-left corner that are barely visible. How do I specify to show the proper zoom slider that users will be familiar with? I have already specified "map.isZoomSlider = true".

This thread answers your zoom slider question:  http://forums.arcgis.com/threads/36441-Default-Zoom-Slider

To style the zoom slider or zoom buttons correctly, add a class="claro" attribute on your body tag (I'm assuming you want claro since that's the stylesheet you've included in your link above). Also, why are you loading the google maps API?
0 Kudos
GarethMann
Deactivated User
Thanks for your swift responses Swingley that was very helpful. I am using "Claro" simply because I am basing most of my code on the samples online and that is what they use.

As for the Google Maps API, I need that for the geocoding, which will be the next step if an exact address match is not found. The goecoding in ArcGIS 10 is realy poor and cannot compete with google Maps for accuracy.
0 Kudos
derekswingley1
Deactivated User
Thanks for your swift responses Swingley that was very helpful. I am using "Claro" simply because I am basing most of my code on the samples online and that is what they use.

Glad to help. Were you able to fix the map service disappearing issue?


As for the Google Maps API, I need that for the geocoding, which will be the next step if an exact address match is not found. The goecoding in ArcGIS 10 is realy poor and cannot compete with google Maps for accuracy.

I keep hearing that our geocoder is continuously improving...but I guess there's still work to be done. I'm not sure if it's worth the effort, but you can always set up your own geocoder with ArcGIS Server. There might also be terms of service issues with what you're doing but I'm not the right person to discuss those issues.
0 Kudos
StephenLead
Honored Contributor
There might also be terms of service issues with what you're doing


Derek's correct - the Google Maps API documentation says:

Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.


If you want an address search like Google's, you can try writing your own code to wrap around the ArcGIS geocoder. Eg, work out which parts of the entered string are the number, road name, road type, and suburb, then run a geocoding query using those parameters.

Here is an example script showing one possible approach to parsing the address to determine its components. You would then feed this information into a geocoding operation, knowing which section was the street name, etc.

Steve
0 Kudos