The problem is that you manually call setCenter on the map so what
actually happens is that the url arguments are parsed, the map is
center on the coordinates given in url, and then the map is centered
to (-0.1, 51.5, 11).
You should ensure that the map hasn't already been centered before you
call setCenter with something like the following :
if (!map.getCenter()) {
var lonLat = new OpenLayers.LonLat(lat,
lon).transform(map.displayProjection, map.projection);
map.setCenter(lonLat, zoom);
}
Pierre
On Tue, Jan 4, 2011 at 3:41 PM, Tom Chance <[email protected]> wrote:
> I've been having problems with a permalink, where the lon/lat/zoom arguments
> in the URL aren't working. The layers argument works fine. Can anyone spot
> why? I started out with a slightly more complicated script + css, then
> stripped it back to this more basic version when I noticed the problem.
>
> http://tomchance.dev.openstreetmap.org/OpenEcoMaps/map_embed.php
>
> Thanks,
> Tom
>
> --
> http://tom.acrewoods.net http://twitter.com/tom_chance
>
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
>
--
Pierre GIRAUD
Géomaticien, Analyste
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex
Tel : 00 33 4 79 44 44 93
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users