V
V
Vadim Yagofarov2019-05-25 10:46:16
JavaScript
Vadim Yagofarov, 2019-05-25 10:46:16

How to change marker on google maps?

Good afternoon! Tell me what I'm doing wrong. I want to change the marker on Google maps, but for some reason it does not change
5ce8f25281df8838953070.png

export default () => {
    var uluru = {lat: 30.4038841, lng: -86.604427};

    var map = new google.maps.Map(document.getElementById('map'), {

        disableDefaultUI: false,
        mapTypeControl: false,
        streetViewControl: false,
        zoom: 15,

        center: uluru

    });
    var customMapType = new google.maps.StyledMapType([{"stylers": [{"saturation": -100}]}, {
            "featureType": "poi",
            "stylers": [{"visibility": "off"}]
        }],
        {name: 'Custom Stysle'});
    var customMapTypeId = 'custom_style';
    map.mapTypes.set(customMapTypeId, customMapType);
    map.setMapTypeId(customMapTypeId);

    var marker_image = '../img/sprite/Rectangle.svg';
    var marker = new google.maps.Marker({
        position: uluru,
        map: map,
        icon: marker
    });

}
Грешу на неправильный путь, но в таком случаев в консоли бы была бы ошибка, я так предполагаю.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yarovikov, 2019-05-25
@GIRUPC

icon: marker_image

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question