ThinkGeo.com    |     Documentation    |     Premium Support

Display tool tip on mouse over the feature

Hi,

I have started working with Thinkgeo Web Edition recently. I am getting Map click and Double click Events there. But it looks like there is no Map Mouse move/over event. And I have observed MarkerOverlay Tooltip but i don’t want that, since it is only for Point features. So I have decided to do it from Client side. And my client side code is follows.

var olMap;
var OnMapCreated = function (map) {
olMap = map;
olMap.events.register(‘mouseover’, map, mapMouseOver);
olMap.events.register(‘mousedown’, map, mapMouseDown);
}

function mapMouseOver(e) {
var lonlat = olMap.getLonLatFromPixel(e.xy);
}

From the above lines i am getting coordinates of map on mouse move.

Now my requirement is I have a InmemoryFeatureLayer with Polygon features displayed on map. Each polygon feature has some attributes i have added. Now I wanted to display those attribute values on mouse over it.

I am able to get map Overlays with following code in client side.
overlay = olMap.getLayer(‘Sigmet’);
But i don’t have an idea to continue further.

Same thing I have done in Desktop edition like this in map mouse move event…

wfMap.FindFeatureLayer(“SigmetLayer”).Open();
Collection flabels = wfMap.FindFeatureLayer(“SigmetLayer”).FeatureSource.GetFeaturesWithinDistanceOf(WorldPointR, wfMap.MapUnit, DistanceUnit.NauticalMile, 0.5, ReturningColumnsType.AllColumns);
wfMap.FindFeatureLayer(“SigmetLayer”).Close();

so that i am getting result, and i can access the attributes from it like flabels[0].ColumnValues[“SigmetID”].ToString();

Please provide me sample for how to do it in Web Edition .

Thank you,
Ashok

Hi Ashok,

Thanks to let us know your scenario.

I think this topic is helpful and you can view the sample there: Showing tooltip for line, point feature shape file on client side

Regards,

Ethan