How to set the center of the map using Javascript and Subgurim Maps

I want to set the center of the map using Javascript.

I can only find code with markers in it, but I need client-side code for this:

/* Server code */
GMap1.setCenter(latlng, zoomLevel, mapType  );

I would like to do this (this is non-working code :-))

<script>
    subgurim_GMap1.SetCenter(47.1, 2.3, 6)
</script>

If 47.1 and 2.3 are Lat / Lng, and 6 is the zoom level.

+3
source share
1 answer

Try the following:

map.setZoom(6);
var point = new GLatLng(26.228595038041917, 50.54535984992981);
map.setCenter(point);
+3
source

Source: https://habr.com/ru/post/1718988/


All Articles