E
E
Egor Rublev2016-08-21 21:09:02
JavaScript
Egor Rublev, 2016-08-21 21:09:02

I'm trying to add coordinates through a variable, why doesn't it work?

Hello everyone, who knows why it doesn't work if you put a variable in the Yandex map coordinates?

x = '[59.91815363876071,30.30557799999997]'
center: x


but if you write like this, it works
center: [59.91815363876071,30.30557799999997]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis, 2016-08-21
@FaloSun

In the working version, you have an array, and in yours, a string.
var x = [59.91815363876071,30.30557799999997];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question