volga-volga / react-native-yamap

React Native Yandex Maps | Яндекс Карты | Yandex.MapKit implementation for react native | YandexMaps
144 stars 80 forks source link

Менять цвета карты #267

Open anis-18 opened 7 months ago

anis-18 commented 7 months ago

Скажите пожалуйста как можно менять цвета карты на черны и белый ?

photo_2023-11-09_10-36-09

alen-s commented 7 months ago

Из файла readme в пакете видно, что "mapStyle" программируется по https://yandex.ru/dev/mapkit/doc/ru/style

anis-18 commented 7 months ago

Из файла readme в пакете видно, что "mapStyle" программируется по https://yandex.ru/dev/mapkit/doc/ru/style

А как сделать её черной белой ?

alen-s commented 7 months ago

Я еще не проверял, но можете ли вы попробовать и сообщить, работает ли это?

const mapStyle = "[" +
            "        {" +
            "            \"types\": \"point\"," +
            "            \"tags\": {" +
            "                \"all\": [" +
            "                    \"poi\"" +
            "                ]" +
            "            }," +
            "            \"stylers\": {" +
            "                \"color\": \"f00\"" +
            "            }" +
            "        }" +
            "    ]";

<YaMap
        mapStyle={mapStyle}
</YaMap>

Reference: https://yandex.ru/dev/mapkit/doc/ru/style#howto 2023-11-27_12-53

ch3rn1k commented 6 months ago

Яндекс сделал даже визуал уже, пользуемся https://yandex.ru/maps-api/map-style-editor