[OpenLayers-Users] permalink on dynamic pages?

Christopher Schmidt crschmidt at metacarta.com
Wed Sep 3 09:17:54 EDT 2008


On Wed, Sep 03, 2008 at 02:45:25PM +0200, mc.prins wrote:
> $mapid gets replaced serverside by the id attribute of the olmap tag shown 
> above. the create map function does:
> 
> 	m.addControl(new OpenLayers.Control.Permalink( {
> 	    'div' :OpenLayers.Util.getElement(mapOpts.id + '-statusbar-link')
> 	}));
> where mapOpts.id === $mapid
> 
> I do the same for the scale and coords and these work fine..

And the Scale and coords controls are both 'more modern' and work
differently. Permalink doesn't take an options hash as its first
argument, it takes an element (or element id): specifically, an element
of an 'a' tag, that it will update the href of.

Again, refer to http://openlayers.org/dev/examples/controls.html , which
has a permalink outside the map, for an example.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list