Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps remove default man icon

i am using google maps with my project as you can see here ( Demo )

in left top you can see man icon and zoom i want to remove man icon and set zoom left-top what should i do? i am using this library js library and you can see other library in (view) source demo link [3] this is my aim.look left top please

like image 599
user1688401 Avatar asked Jun 26 '13 17:06

user1688401


People also ask

How do I get rid of the default marker on Google Maps?

Click the "My Places" button just beneath the search bar. Click "Maps" and wait for the list of maps to appear down the left side of the screen. When they do, click the title of the map containing the marker that you want to remove.

How do I get rid of default marker?

You can remove an existing marker by setting up the marker to null using the marker. setMap() method.

How do I hide pegman on Google Maps?

setOptions({streetViewControl: false}); removes the pegman control box in the upper left, but still ends up leaving the pegman on the map. If you want to HIDE the Street View control you need to place streetViewControl option before mapTypeId . Otherwise, you end up with the Street View control showing disabled.


2 Answers

I hope you work

function initialize() {
   var mapOptions = {
   zoom: 8,
   center: new google.maps.LatLng(-34.397, 150.644),
   disableDefaultUI: true,   //disables controls
   zoomControl: true,        //zoom control enables
   zoomControlOptions: {
    style: google.maps.ZoomControlStyle.LARGE,  //enables the dimension
    position: google.maps.ControlPosition.TOP_RIGHT  //position enables
    },

   mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  map = new google.maps.Map(document.getElementById('map-canvas'),
  mapOptions);
  }
like image 173
Shortys Oberto Dutari Avatar answered Oct 19 '22 19:10

Shortys Oberto Dutari


The above answers do not meet your question. Try this caused its work for me to disable the people icon.

mapTypeControl:false,
scaleControl:false,
streetViewControl:false,
overviewMapControl:false,
rotateControl:false, 

if you want to remove all then use this :

mapTypeControl: false,
disableDefaultUI: true,

if you want to style the map color, try this :

var mapStyles = [ {"featureType":"road","elementType":"labels","stylers":[{"visibility":"simplified"},{"lightness":20}]},{"featureType":"administrative.land_parcel","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"transit","elementType":"all","stylers":[{"saturation":-100},{"visibility":"on"},{"lightness":10}]},{"featureType":"road.local","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"road.local","elementType":"all","stylers":[{"visibility":"on"}]},{"featureType":"road.highway","elementType":"labels","stylers":[{"visibility":"simplified"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"visibility":"on"},{"lightness":50}]},{"featureType":"water","elementType":"all","stylers":[{"hue":"#3b5998"},{"saturation":30},{"lightness":49}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"hue":"#3b5998"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"hue":"#3b5998"}]}, {featureType:'road.highway',elementType:'all',stylers:[{hue:'#3b5998'},{saturation:-92},{lightness:60},{visibility:'on'}]}, {featureType:'landscape.natural',elementType:'all',stylers:[{hue:'#3b5998'},{saturation:-71},{lightness:-18},{visibility:'on'}]},  {featureType:'poi',elementType:'all',stylers:[{hue:'#3b5998'},{saturation:-70},{lightness:20},{visibility:'on'}]} ];

change color attribute # as you like, then put this style in your map :

mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 9, // optional based on your requirement
styles: mapStyles 

If you want to style the icons, then put this :

marker = new google.maps.Marker({
icon: "/images/icon/marker123.png", // based on your dir file
position: point, // based on your srcipt selection
map: map

Hope this useful for others. :)

like image 22
3 revs, 2 users 98% Avatar answered Oct 19 '22 19:10

3 revs, 2 users 98%