2

是否可以在您自己的地圖(網絡)中使用谷歌地圖中的默認藍點標記?谷歌地圖v3默認(動態)藍點作爲標記

遠射:我使用離子/科爾多瓦,所以我編譯網絡谷歌地圖到iOS。是否也可以使標記動態並在標記上顯示手機指向的方向,如在Google地圖中所示?

感謝

回答

1

是否有可能使用在谷歌地圖默認的藍色圓點標記在 自己的地圖(網絡)?

你是什麼意思,你不能只用一個藍點圖標嗎?或者當你在谷歌地圖上出現藍點時,谷歌已經投入了一些功能(總是遵循道路,平穩移動等)。因爲我認爲這通過谷歌的API無法使用。

+0

我的意思是谷歌使用的藍點,它的方向性和準確性功能,是的。恐怕是這樣,它不可用。 – huahax

-1

爲什麼你使用V3的JavaScript,谷歌地圖V2本機在設備上更好,更快。 如果您需要此映射JavaScript,出於某種原因, 唯一的可能性是使用geolocation.getCurrentPosition獲取當前位置並在間隔中生成。 代碼是這樣的:

// Initialize the Google Maps API v3 
var map = new google.maps.Map(document.getElementById('map'), { 
    zoom: 15, 
    mapTypeId: google.maps.MapTypeId.ROADMAP 
}); 

var marker = null; 

function autoUpdate() { 
    navigator.geolocation.getCurrentPosition(function(position) { 
    var newPoint = new google.maps.LatLng(position.coords.latitude, 
              position.coords.longitude); 

    if (marker) { 
     // Marker already created - Move it 
     marker.setPosition(newPoint); 
    } 
    else { 
     // Marker does not exist - Create it 
     marker = new google.maps.Marker({ 
     position: newPoint, 
     map: map 
     }); 
    } 

    // Center the map on the new position 
    map.setCenter(newPoint); 
    }); 

    // Call the autoUpdate() function every 5 seconds 
    setTimeout(autoUpdate, 5000); 
} 

autoUpdate();