1

I am trying to display users on a map, i have already implemented the map in the app, but now i am trying to make custom markers that display a users' photo inside the pin something like this: Custom markers , how can i accomplish this?

To clarify, what i am trying to do is display a bitmap inside a marker icon bitmap

  • 1
    This link might help you >> http://stackoverflow.com/questions/14811579/how-to-create-a-custom-shaped-bitmap-marker-with-android-map-api-v2 – mgcaguioa Jun 28 '16 at 02:09

1 Answers1

2

You can define an icon to show instead of the default marker image. Defining an icon involves setting a number of properties that determine the visual behavior of the marker. Below code should do the trick.

function initMap() {
  var map = new google.maps.Map(document.getElementById('map'), {
    zoom: 4,
    center: {lat: -33, lng: 151}
  });

  var image = 'filePath' + 'usersPhoto.png';
  var beachMarker = new google.maps.Marker({
    position: {lat: -33.890, lng: 151.274},
    map: map,
    icon: image
  });
}

Check the Google Maps API for details https://developers.google.com/maps/documentation/javascript/examples/icon-simple#try-it-yourself

Pankaj
  • 474
  • 1
  • 3
  • 16
  • I am not using javascript, i know how to change the icon, i need a way to put the user image inside a pin,like in the example i mentioned. thanks anyways – Sapir Melchin Jun 28 '16 at 02:36