{ Don't Repeat Yourself ! }

Browsing Posts published in May, 2011

Safari, Chrome and Firefox work great with the facebook like button.

But to get internet explorer to display it I had to add the facebook namespace to my html tag.

<html  xmlns:fb=””
xmlns:og=”” … >


Probably one of the first things you would want to do with an openlayers map is adding some interaction.
Amazingly it is difficult to find an easy and quick example on how to do it.

Here is an example on how to move an Openlayer.Marker to the point where a user clicked on the map.


var markers = new OpenLayers.Layer.Markers( "Markers" );
marker = new OpenLayers.Marker(lonLat) ;
map.addLayer(markers);"click", map , function(e){
var opx = map.getLayerPxFromViewPortPx(e.xy) ; = map ;
marker.moveTo(opx) ;

Another example can be found on the openlayers examples page.
I found it a bit overkill though and more difficult to use.

This error occurs on line 915 in Openlayers.js.

If you get this error when using the moveTo method of an OpenLayers.Marker object  set the map on the marker first.

e.g. = map ;
mymarker.moveTo(opx ) ;



Get Adobe Flash player