I've got a little problem with OpenLayers.
I've a simple function which sets the center of the map to the position of the user – this works fine. But: it should also zoom – which, for an unknown reason, don't work.
Any ideas?
function gotSomeLocation(position){
var lat = position.coords.latitude;
var long = position.coords.longitude;
map.zoomTo(18);
alert("Lokalisiert!");
map.setCenter(tCoord(long, lat));
}
Best Answer
use sth. like this:
.
Usage:
you dont also need to use
map.zoomTo(18);
setCenter
i hope it helps you...