Anonymous
03-11-2005, 04:44 PM
I am writing a delphi application with mappoint controls. In my program I can add several stops, set them up as pushpins and optimize the route. Also I can show the address in a text box when I move the mouse over to the stops. However, it is so awkward since the mouse has to be placed on the exact location on the map to get the text box. Is there anyway that the mouse doesn't need to be put on the exact location on the map and still shows me the text box with address? I am using ObjectFromPoint to convert the X and Y coordinates to get the mouse location. Is it ok or if there is another way to do it. If someone shows me some sample codes that will be great. Thanks. :)
Wilfried
03-12-2005, 03:17 AM
Hi,
Instead of ObjectsFromPoint you could use FindNearby. The distance has to be according the zoom level (Altitude), so that when the mouse is near the pushpin, the textbox can popup.
To not slow down I think it is good to only calculate when the mouse does not move for some time. Eg by posting a custom message to a thread in the MoseMove event, and the thread can fire an event to a custom message handler when it did not received a mouse move message for a while. A timer can do also, not sure what is the best.
Anonymous
03-14-2005, 10:07 AM
Hi
Thanks for your reply. :)
But I just have a stupid question cuz I am still new to the mappoint controls. If I don't use ObjectsFromPoint, how can I get the location from the X and Y coordinates so that I can use the FindNearBy method?
Wilfried
03-14-2005, 01:00 PM
Hi,
You can use XYToLocation to get a Location object from x,y points.