Answer the question
In order to leave comments, you need to log in
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
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question