Answer the question
In order to leave comments, you need to log in
How to convert a string to coordinates?
the bottom line is that I get a string from the request (for my file). This string contains the coordinates as a string. I need to get the coordinates from this line (for example: '[55.751574, 37.573856]' or '55.751574, 37.573856').
here is the code
ymaps.ready(func);
function func()
{
var x = new XMLHttpRequest();
ymaps.ready(f);
function f()
{x.open("GET", "http://address/pos.php?login=DdyKNQ9FNQDnB9YifiY2&password=59FyAhtHt782KFninDZy", true);
x.onload = function (){
map1.geoObjects.add(new ymaps.Placemark( x.responseText, {
balloonContent: "Местоположение пользователя"
}, {
preset: "islands#circleDotIcon",
iconColor: "#1faee9"
}));
}
x.send(null);
timerId01=setTimeout(function(){f();},10000); }
}
Answer the question
In order to leave comments, you need to log in
placemark is not shown because I'm giving coordinates in the wrong format. How to give them in the right format?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question