I am trying to use tooltip using InMemoryFeatureLayer. I know i can use markers but markers are a point, if i have a polygon in my InMemoryFeatureLayer i cant have a tooltip when i hover the outline of the polygon, a work around would be to use a marker in the center of my polygon, but sometimes the center of the polygon is difficult to find (case of a multipolygon, or a concave shape)
I came across the forum and apparently it is not possible to have a tooltip in the InMemoryFeatureLayer because this layer is not rendered as a vector but as an image. Besides some layer are rendered as vector, like the editoverlay, i guess i can use an hover event and display a tooltip. The main drawback of the editoverlay is that i cant assign a different color for each shapes displayed, besides i dont think i can display the shapes according to the zoom level.
Hello
I found a solution in a old thread gis.thinkgeo.com/Support/Discussion...fault.aspx
I am afraid of the performance, the solution is to have a timer which postback every second and we check if the mouse is inside one of the polygon. In my case i have small amount of shapes to display and the geometry WKT of my shapes arent not too big so I think it is not a problem to transfer the feature in the client.
My question is is there a layer in thinkGeo which can display shapes in different colors, make the shapes visible according to the zoom level and transfer the feature (shape + tabular information) in the clientside?
If this such layer does not exist, is it simple to create a new one?
If it is not possible to use other layers, here is what i think i can do.
- use InMemoryFeatureLayer to render shapes in different color
- use EditOverlay with the same shapes and make them transparent so i can use an hover event and display a tooltip containing informations i transfered on the client side in a hidden field (or make a postback to retrieve information using the feature id of the hover event)
What do you think about all this possible solution?
Sebastien