S
S
Suffering19922019-07-10 09:50:27
JavaScript
Suffering1992, 2019-07-10 09:50:27

How to place one map in different places with different centers from the Yandex map constructor?

The idea is this, there is a map in the constructor on which there are a lot of objects in one city. You need to use this map on different sites with different centers.
Problem: I set the center of the map as it should, I take the js code, I place the map. I do the same procedure again, set another center, zoom, place. On the first map, the center is now the same as on the last one.
Question: how to make it so that on the first map the center was unchanged and on the second, third ... it was also unchanged?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Suffering1992, 2019-07-10
@Suffering1992

I found the solution myself:
1. Open the map in view mode
2. Set the center of the map and click share:
3. Insert the code on the site
4. Disable scrolling using this method .
Voila

A
Andrew, 2019-07-10
@deepblack

Without a constructor:
Create several different instances of the class ymaps.Mapwith the settings you need (center, zoom)
Using the objectManager add Geo-objects to the desired map(s)
Export map objects

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question