Been looking for a similar solution. The best advice I've gotten is to
select the feature and then iterate through its vertices to find the one
closest to the mouse position. This feels like something of a
workaround, but short of getting deep into the OL js, probably, the best
way to go.
I'd be mighty pleased, however, if someone has a solution that takes
advantage of whatever algorithm does the feature selecting.
You have about 10x the points I have per feature, so clearly the need is
greater for you than me. Maybe if you are fetching a lot of data
anyway, it would make sense to do a server call with appropriate
parameters (track ID, lat, lon) to return the position data.
Good luck!
On 11/12/2010 4:16 AM, Yury Luneff wrote:
I need to implement some kind of history mode in our project that
would show when the vehicle was in particular point user has clicked.
So workflow looks like:
* users selects date range (for ex. today 10:00 am to 10:00 pm) for
vehicle movement
* js asks server for points and dates for this time
* js draws Feature.Vector upon these points and a line is show to user
* user finds his points of interest and clicks in hope to see when the
vehicle was there.
Here i need to respond somehow with js. SelectFeature doesn't do what
i need, boolean feature.geomentry.intersects(point) is a boolean
function while i need to find the closemost basepoint of geometry to
the click. Perhaps, the only fallback for me is to do it on serverside
somehow, but I'm still in hope to do it with openlayers. Solution
should perform tolerable while there is 4320 points in given case (one
in ten seconds).
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users