This is a static archive of our old OSM Help Site. Please post any new questions and answers at community.openstreetmap.org.

OpenLayers: Slowly navigate to the map from one location to another

1

Hello Guys,

Please help me on this, I searched lot but didnt found solution.

first of all I am setting my map at one point suppose my lat long are 19.151568,41.872330

so I am using following code to set my map on load to this points..

var val1 = "19.151568";
var val2 = "41.872330";
var lonLat = new OpenLayers.LonLat(val1,val2).transform(epsg4326, projectTo);
var zoom=18;
map.setCenter(lonLat, zoom);

Now in my js code I am calling one function i.e. changeLocation(var1,var2); where var1 and var2 are my new lat and long for example : 18.950367,41.553726

so my code for changeLocation(var1,var2) is as follows

function changeLocation(var1,var2) {
var zoomlvl = map.zoom;
var lonLat = new OpenLayers.LonLat(val1,val2).transform(epsg4326, projectTo);
map.setCenter(lonLat, zoomlvl);
}

after this function my map immediately goes to that location. where want it to go slowly from previous location to my new location.

Please help me on this.. Thank you guys..:)

asked 14 Aug '15, 06:00

akaAni's gravatar image

akaAni
41112
accept rate: 0%

edited 14 Aug '15, 06:34

scai's gravatar image

scai ♦
33.3k21309459


One Answer:

5

answered 15 Aug '15, 10:40

mmd's gravatar image

mmd
5.7k15388
accept rate: 37%

edited 15 Aug '15, 10:42

about the mapbox solution (or even the OL or leafletjs solution):

is there any software (except GoogleEarth!) or webservice that can display this smooth zoom out and zoom in on an OSM based map, and that can capture or render a video clip from this?

(15 Aug '15, 13:38) stephan75

Thank you very much......

(19 Aug '15, 05:14) akaAni