E
E
Express7772015-10-30 12:15:13
JavaScript
Express777, 2015-10-30 12:15:13

How to show districts of the city on a Yandex map?

Hello.
There is a task to show the administrative districts of the city on Yandex maps.
In addition, each area should have its own color and transparency.
For example, one district of the city is displayed here:
Yandex Map
You need to show all (or several) districts of the city and be able to set their color and transparency.
Tell me how can this be done?
Until I stopped at the very first steps

ymaps.ready(init);

function init () {
    var myMap = new ymaps.Map('map', {
            center: [43.23996, 76.89578],
            zoom: 10
        }),

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ilya, 2015-10-30
@Express777

You can overlay the desired areas of the city with polygons (polygons).
Here is an example of working in a sandbox: https://tech.yandex.ru/maps/jsbox/2.0/polygon
Here is another good, detailed example for a beginner: webmap-blog.ru/yandex-maps/risuem-mnogougolnik-na-..
In order not to outline all areas with your hands, you can find ready-made versions of the list of peaks . I was about to start writing a list of sources, but I came across an interesting discussion on the profile forum, where there is a discussion with all possible questions: forum.openstreetmap.org/viewtopic.php?id=20190
Read to the end, there are a lot of links.

N
Nikita K., 2015-10-30
@bonilka

Here is their API described in sufficient detail https://tech.yandex.ru/maps/doc/jsapi/2.1/dg/conce...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question