How to highlight a user's current location in google maps?

前端 未结 3 1692
Happy的楠姐
Happy的楠姐 2020-12-09 12:47

I am using following code to get the location of user in phonegap (it works fine)

function getLocation() {
    var win = function(position) {
        var lat         


        
相关标签:
3条回答
  • 2020-12-09 13:23

    You can use the newly released GeolocationMarker which is part of the Google Maps API Utility Library.

    It will add a marker and accuracy circle at the user's current location. It also allows a developer to customize the marker using the setMarkerOptions method and specifying an icon property.

    0 讨论(0)
  • 2020-12-09 13:29

    Use icon inside marker like

        var Marker = new google.maps.Marker({
            map: map,
            animation: google.maps.Animation.DROP,
            position: "",
            icon: /bluedot.png
    });
    

    you can use this google map location indication circular blue dot icon similar to the google map

    0 讨论(0)
  • 2020-12-09 13:29

    You can use MarkerOptions to set a custom image. Check the Google Maps Javascript API V3 Reference to more details about Google Maps.

    0 讨论(0)
提交回复
热议问题