25 Mar 2013 9:05 PM #1
Displaying tooltip over WMS points + considering using Ext
I am using WMS layer in my application and I need to display tooltip over my points. I want to use Extjs (Ext.ToolTip) but I am not sure how to get the right position of the tooltip. I see that there is showAt(x,y) method but don't know how to get x,y of each point. also I though of using the courser location but can't figure out how to do it exactly. any help regarding this?
27 Mar 2013 12:54 PM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
I personally haven't used WMS but how do you know what coords to show it or is there an element that you can show by?
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
27 Mar 2013 1:48 PM #3
Is your WMS response being rendered on the page as SVG? My only experience with WMS is that the returned file is an image. The image is either a tile like you see with Google base maps or is an image that's a bit larger than the viewable area of the map. In either case there's not really anything there where you see the 'point' from the layer since it's a rendered flat image with transparency.
If the WMS is a flat image (png):
You could monitor the events like mouseover/move/click and get the XY from the mouse event and from that the mapping API may let you translate the XY to a lat/long which you can use as a lookup in your DB to get what the point is and show a tooltip at the mouseover/move/click location and populate it with data returned from the lookup using the lat/long.
Could you use markers for your points instead of a flat wms png overlay? If so you can monitor mouseover much more easily, though massive marker counts can congest the dom - especially on older browsers.
Can you use WFS instead of WFS for point delivery? It'll be more expensive in the dom since it's rendering SVG polygons rendered from the WFS data, but I've used WFS for points before and the WFS data package coming back from the map server can deliver rich data that you can use in your toolip. That said, it was some surgery getting that to work, but at least the mouse cursor knew where it was in relation to the points on the map.