In theory,
this is how to disable the (built in ) markers:
suppressMarkers
Type: boolean
Suppress the rendering of markers.
And this question, show how to include the code.
but this code, shows my custom icons and the google icons (still..)
var styledMap = new google.maps.StyledMapType(styles, {name: "Son Matías Beach"}); //
var mapOptions = {
zoom: 15,
scrollwheel: false,
center: new google.maps.LatLng(),
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, 'map_style']
}
}
var gmap = new google.maps.Map(document.getElementById('gmap'), mapOptions);
var hotel_lat = new google.maps.LatLng( 39.514801, 2.53708 );
var aero_lat = new google.maps.LatLng(39.551741,2.736165);
var Hotel = new google.maps.Marker({
position: hotel_lat,
title:"Custom name",
icon: '../www/img/logos/map-ico.png'
});
Hotel.setMap(gmap);
var Airport = new google.maps.Marker({
position: aero_lat,
title:"Airport",
icon: '../www/img/airplane.png'
});
Airport.setMap(gmap);
gmap.mapTypes.set('map_style', styledMap);
gmap.setMapTypeId('map_style');
var mapInfoWindow = new google.maps.InfoWindow();
var mapBounds = new google.maps.LatLngBounds();
var directionsDisplay;
var directionsService = new google.maps.DirectionsService();
directionsDisplay = new google.maps.DirectionsRenderer();
directionsDisplay.suppressMarkers = true; /// <-- The line
directionsDisplay.setMap(gmap);
/* ruta del hotel al aeropuerto */
route(aero_lat , hotel_lat );
gmap.setCenter(new google.maps.LatLng( hlat, hlong ));
$(window).resize(function () {
gmap.setCenter(new google.maps.LatLng( hlat, hlong ));
});
Any idea what i'm doing wrong?