Answer the question
In order to leave comments, you need to log in
Yandex API Map not being created?
Good time of the day!
The problem is this:
There is a certain div
<div id="rez" style="width:1000px;height:1000px">Тут будет наша замечательная карта
</div>
function one(){
var myMap = new ymaps.Map("map", {
center: [55.76, 37.64],
zoom: 10
});
//myGeoObject = new ymaps.GeoObject({
//geometry: {
// type: "Point",// тип геометрии - точка
// coordinates: [jsondata.w,jsondata.l] // координаты точки
//}
// })
//i = i+1;
//myMap.geoObjects.add(myGeoObject); // Размещение геообъекта на карте.
}
one();
Answer the question
In order to leave comments, you need to log in
Some kind of tin with logic ...
1. All functions are written in advance and the script with them is loaded initially.
2. The user clicks on the button and receives the data (certainly better in JSON).
3. This data (coordinates etc.) is passed to the function and it uses it to initialize the map.
4. If the map has already been created, and you can click on the button again, you can either re-create it or correct the current one. You don't need to insert anything into
the block, destined by fate to be a container for the map .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question