Home computickets How to build an iframe link at coordinates with a map whose...

How to build an iframe link at coordinates with a map whose center points to these coordinates?




The task is to open an iframe and pass it the generated link by coordinates like the following:

https : //yandex.ru/maps/? l = map & amp; ll = 54.484167N, 72.878889E & amp; spn = 54.484167,72.878889 & amp; z = 15
when trying to do this, I get the following error:

Refused to display ‘https://yandex.ru/maps/?l= map & amp; ll = 54% C2% B029% E2% 80% B23% E2% 80% B3N, 72% C2% B052% E2% 80% B244% E2% 80% B3E & amp; spn = 54.484167,72.878889 & amp; z = 15 & amp; ; output = embed ‘in a frame because it set’ X-Frame-Options’ to ‘deny’.

Can you please tell me if there is a way to generate the correct link using the available coordinates so that it would refer to non-prohibited content?

Answer 1, authority 100%

The Yandex.Maps website itself cannot be opened in an iframe and embedded on someone else’s service. There is a special Yandex.Maps Widget for your task.

Where to get the Widget code

  • Go to Yandex.Maps
  • Looking for the right organization or building a route
  • In the menu = select the item “Share”
  • Get the code for the site

You can also “substitute” your link into the Widget, but you need to understand that Yandex.Maps does not have a public url-scheme – the parameters and format of values ​​can change, which means that your entire generation can break at any time.

The code will look something like this:

& lt; iframe src = "https://yandex.ru/map-widget/v1/?ll=37.624513%2C55 .748635 & amp; z = 12 "width =" 560 "height =" 400 "frameborder =" 1 "allowfullscreen =" true "& gt; & lt; / iframe & gt;

View an example

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions