Custom marker on Google Maps

Asked

Viewed 2,178 times

1

How do I embed Google Map but with Custom Marketer? Do you have any public Google Maps Apis (which do not require access key)? Currently I need to include "whole" API, just to run the operation to pick up (previously) a latitude, longitude and image of the Marker and mark on the map.

Java Script

  • Is Javascript? Android? What Exactly?

  • Oh what a mistake. It’s Java Script

1 answer

3


To include the map, as you should already be doing and as indicated in documentation, You really don’t need any keys for that. Therefore, to customize the markers is also not necessary a key, just change the parameters of this marker, including the property icon, as shown here.

For example, once you have in your files an image new_marker.png, just having something like that:

var iconBase = 'http://www.seusite.com.br/icones/';

var marker = new google.maps.Marker({
  position: myLatLng,
  map: map,
  icon: iconBase + 'novo_marcador.png'
});
  • 1

    Thanks buddy, after I read you don’t need a key, it got simpler. I even created a mini API, where you pass (via attributes) the latitude, longitude, icon and scale, then via API, calculate the height (with scale), create the map (incorporates the Google API also via API), set the location and icon. So every time I need to create a map with the marker,.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.