Select to view content in your preferred language

best way to get hover and click tooltips on large point layer

3971
7
11-19-2012 07:21 PM
KeG
by
Deactivated User
I have multiple (~10) point layer that have the potential to contain about 1 to 5 thousand features each.
I want to provide hover tooltips and also click events.
10.1

will probably restrict the scale on these layers to reduce the amount of points visible at any one time to, maximum, say 100 at a time.

Should i use a Feature Layer? Or would dynamic cut it?
should i load all points right at startup or is there a way to do just the extent maybe?

would i do an infowindow against points in the graphic layer after a query?
or is there a way to not use client side graphics layer.
I tried a sample that used the graphics layer and it created a graphic over the marker that is already in the layer. i dont need any more graphic in that case, just the onmouseover event.

is there another more efficient way i have missed?

thanks for suggestions...
0 Kudos
7 Replies
JohnGravois
Deactivated User
a dynamic map service layer will only retrieve map tiles from the server, so attributes wouldn't be available on the client side for features.

a feature layer essentially handles the querying and population of a graphics layer for you.  If you can restrict the display of the feature layer until the map is zoomed in you could work with it "on demand", otherwise you might think about loading the same data as a dynamicMapService and working with the featureLayer in "selection" mode.
0 Kudos
KeG
by
Deactivated User
I was able to get two options working:
I used a Map Service added as a DynamicMapService layer along with a query to create graphics for all of the points when the map loads. then i added graphics for each query result and did the mouseOver on the graphics to get an infoWindow. That works but requires me to preload all of the points with a query. not exactly what i want as there is overhead at the start.

I also used the new FeatureService to make graphics and used the popup on mouseOver. I like the look of the popup better but i noticed an issue - when i was in ondemand mode and i panned new features were pulled in as i changed the map extent but not the information for the popup. So i had popups available for the features that were in the initial extent but not those that came into view as a result of the pan.
When i just used selection mode then i was able to get the popup/featureService to work but that solution suffers from the same issue in that i'm loading all of the features into memory when the app starts up.
0 Kudos
KeG
by
Deactivated User
so far the best ui experience has been with using the infowindow on graphics that i query onload from the dynamicMapLayer and add. But if my layer has more than 1000 features i exceed the transfer limit and some points are not getting graphics or tooltips. another issue is that i don't want a graphic over each of my points. i just want to see the renderer.

the ondemand featurelayer is spotty. some points don't get tooltips at all for some reason while others near them do. and after panning some have tooltips and others do not.

should i be trying to rig something up where i use the map extent to further refine my query and just blocking users from seeing more than 1000 points by scale rendering?

I gotta say that the options related to tooltips are a little overwhelming. its nice to have options but just seem to be too many ways to skin the cat.
0 Kudos
DerekMiller
Deactivated User
Unfortunately, I haven't found a straightforward way to show popups/tooltips/infoWindows on points via hover. The only layer type that I've been able to track down that has an 'onmouseover' event is the graphics layer... which as you mention, requires that you place a graphic at each point.

I suppose you could set a renderer, which would replace the symbology coming from your mxd with a graphic.

I'd be interested to know if you find a solution for this.

- d
0 Kudos
DerekMiller
Deactivated User
this needs a lot of refinement, but the popup shows on hover and on click:

http://jsfiddle.net/dmiller/Q4LWt/
0 Kudos
KeG
by
Deactivated User
very interesting. what is this dojo parser business?
0 Kudos
DerekMiller
Deactivated User
very interesting. what is this dojo parser business?


To the best of my understanding it's an optional module that creates dijits from dom nodes that are explicitly declared. Think it only applies to dojo 1.7+ AMD, but I'm not sure about that.

http://dojotoolkit.org/reference-guide/1.8/dojo/parser.html

- d
0 Kudos