[OpenLayers-Users] Looking for Example interface for auto-re-centering of view (from URL call)

Basques, Bob (CI-StPaul) bob.basques at ci.stpaul.mn.us
Wed Oct 24 13:45:22 PDT 2012


Curt,

We've already implemented some of your suggestion here: http://pwultra5.ci.stpaul.mn.us/cp_tiles/OL/DEV/AVL.direct.01.html (NOTE: the Left hand Report FORM does not work outside our domain [yet])  Still working on this, has some button event conflict still in there, etc.

Just pick on one of the markers on the map, and you should see a popup window open up.  The idea is to add a zoomed in map to the popup window for auto Tracking of a vehicle (or vehicles) in the popup. You can see near the bottom of the page source where we are pulling the new window from, another note here, we're cheating and using our local coordinate system instead of LAT/LON values, so I can simply send a mapext to MapServer for the info output, should be easy enough to template out a OpenLayers window in the output as well, similar to the parent map.  There is even some timer code in the parent page that we use for updating the map, I should be able to use the same to get new center points . . . for panning.

Bobb



From: curtolson at gmail.com [mailto:curtolson at gmail.com] On Behalf Of Curtis Olson
Sent: Wednesday, October 24, 2012 3:07 PM
To: Basques, Bob (CI-StPaul)
Cc: openlayers-users at lists.osgeo.org
Subject: Re: [OpenLayers-Users] Looking for Example interface for auto-re-centering of view (from URL call)

Hi Bob,

I have used map.panTo(lonlat); and map.moveTo(lonlat); here in my project.  panTo() is fancy and smooth if you are running on a faster computer, but is laggy and jumpy if you are running on a slower device (like maybe a smart phone.)  moveTo() just does a direct jump.  I've used map.getPixelFromLonLat(lonlat); to get the pixel location of the item of interest and then if it's too far from center I do the call to moveTo()

Hope that helps, but if not, sorry for the line noise. :-)

Curt.


On Wed, Oct 24, 2012 at 2:47 PM, Basques, Bob (CI-StPaul) <bob.basques at ci.stpaul.mn.us<mailto:bob.basques at ci.stpaul.mn.us>> wrote:
All,

Anyone know of a demo that Auto-recenters view from a URL call.  Want to zoom to a point on a map, and recenter the view based on a URL.

The idea is to stay tuned to a tracking GPS in a Fleet asset, and basically follow along as they move.

Thanks

Bobb




_______________________________________________
Users mailing list
Users at lists.osgeo.org<mailto:Users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/openlayers-users



--
Curtis Olson:
http://www.atiak.com<http://www.atiak.com/> - http://aem.umn.edu/~uav/
http://www.flightgear.org<http://www.flightgear.org/> - http://gallinazo.flightgear.org<http://gallinazo.flightgear.org/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121024/5126dcac/attachment.html>


More information about the Users mailing list