Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps v3 default (dynamic) blue dot as marker

Tags:

Is it possible to use the default blue dot marker in Google Maps in your own map (web)?

Long shot: I use ionic/cordova, so I compile the web Google Maps to iOS. Is it also possible to make the marker dynamic and show on the marker the direction the phone is pointing, as in Google Maps?

Thanks

like image 828
huadev Avatar asked Feb 14 '17 10:02

huadev


2 Answers

I had success using this:

var map = new google.maps.Map(document.getElementById('map');
var latLng = {"lat": 42.819213, "lng": -83.11099150000001};
var marker = new google.maps.Marker({
  position: latLng,
  map: map,
  icon: {
    path: google.maps.SymbolPath.CIRCLE,
    scale: 10,
    fillOpacity: 1,
    strokeWeight: 2,
    fillColor: '#5384ED',
    strokeColor: '#ffffff',
  },
});

All this does is it places a marker as a blue dot, but further functionality is possible.

enter image description here

like image 181
stevenspiel Avatar answered Sep 25 '22 10:09

stevenspiel


Is it possible to use the default blue dot marker in Google Maps in your own map (web)?

What do you mean, can't you just use an icon of a blue dot? Or are you after some of the functionality google has put into it when the blue dot appears in google maps (Always follows roads, moves smoothly etc). Because I think this unavailable via google's API's.

like image 25
Jørgen Svennevik Notland Avatar answered Sep 25 '22 10:09

Jørgen Svennevik Notland