[GIS] Is it possible to create a tooltip with a map service

arcgis-javascript-apiarcgis-local-governmentarcgis-serverjavascript

I am trying to modify the ESRI Parks Finder application to include a tooltip that shows the name of a park when you mouse hover over the icon. It is a map service. Most of the documentation I have seen shows doing this with either a feature service or graphic. In fact, there are other areas in the application that utilize tooltips but they are based on graphics not the actual symbology of the data.

Any ideas or help on how I can go about this?

Best Answer

Short Answer You can't do this with out of the box API/Classes.

Long Answer: A Map service, be it dynamic or tiled, is fundamentally, just an Image for your JavaScript client App in the browser. How will it know where a feature starts and ends?

The Human eye sees patterns, and can make out where a feature starts and ends. You need to program, so that JavaScript can figure out where a feature exists, so that it can show the Tooltip at the appropriate location.

This is usually done using a Feature Services, and placing the features in a graphic Layer. There are also some advances done in decreasing the overheads of Vectors in web Mapping by using UTF grid. However, I haven't seen the implementation of UTFgrid with the ArcGIS JSAPI.

So now you need to enable the recognition of features from images (i.e. from your Map Service). It is definitely possible, but not easy. I have explained how this can be done in this Answer. But making it so that you can recognize additional Attributes like Park Name, is not going to be easy, since there are potentially thousands of park names.

To Summarize, it is possible, but not trivial.