0

I want to make custom markers. I created custom icon, but i want dinamicly to place another picture on marker to look like this http://iwebask.com/blog/wp-content/uploads/2014/03/Map-Icons-Markers-Collection-PSD.jpg . Base icon is always the same, but icon inside pin are dinamicly. My icon is always like this red pin, but i only change symbols(like heart on this pic). How can i do that?

pepper
  • 7
  • 2
  • those markers come like that. if you want to dynamic place a symbol one way i know is to use PHP and imageMagick library. -- http://www.imagemagick.org/ – Tasos Jul 28 '14 at 10:53
  • possible duplicate of [Best way to display a custom Google maps multiple image marker icon](http://stackoverflow.com/questions/18838259/best-way-to-display-a-custom-google-maps-multiple-image-marker-icon/18838385#18838385) – geocodezip Jul 28 '14 at 11:11

1 Answers1

1

You just have to upload the images, and give the relative paths to the script for all the images.

var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/';
var icons = {
  parking: {
    icon: iconBase + 'parking_lot_maps.png'
  },
  library: {
    icon: iconBase + 'library_maps.png'
  },
  info: {
    icon: iconBase + 'info-i_maps.png'
  }
};

function addMarker(feature) {
  var marker = new google.maps.Marker({
    position: feature.position,
    icon: icons[feature.type].icon,
    map: map
  });
}

Please refer to this link for further modifications

Regards D.

DevangKantharia
  • 704
  • 3
  • 10
  • I understend that, but i need to put my own images, not this ones from google. – pepper Jul 28 '14 at 11:02
  • @peper -- i do exactly the same and i use PHP for that to overlay a symbol on a custom marker. I don't think there's a Jquery way, but not 100% sure. -- http://www.imagemagick.org/Usage/compose/#over – Tasos Jul 28 '14 at 11:07
  • Hey pepper, please refer to this [link](http://stackoverflow.com/questions/10764781/display-custom-marker-in-google-maps-using-relative-file-path), it will solve your problem. Regards D. – DevangKantharia Jul 28 '14 at 11:11
  • Hey, I have also got on more [LINK](http://powerhut.co.uk/googlemaps/custom_markers.php), that can be helpful to customize the design of the markers. – DevangKantharia Jul 29 '14 at 12:45