###前提
cordova でアプリ開発をしています.
cordova-plugin-googlemaps というプラグインを使用しています.
"cordova-plugin-googlemaps"ってなに?
マーカーのアイコン画像の変更をしたく,下記のようなコードを書きました.
JavaScript
1 document.addEventListener("deviceready", function() { 2 // Get the current device location "without map" 3 var option = { 4 enableHighAccuracy: true // use GPS as much as possible 5 }; 6 plugin.google.maps.LocationService.getMyLocation(option, function(location) { 7 8 // Create a map with the device location 9 var mapDiv = document.getElementById('map_canvas'); 10 var map = plugin.google.maps.Map.getMap(mapDiv, { 11 'camera': { 12 target: location.latLng, 13 zoom: 16 14 } 15 }); 16 17 // Add a marker 18 var marker = map.addMarker({ 19 'title': 'I am here', 20 'position': location.latLng, 21 'icon': 'icon.png', // ここが効かない 22 }); 23 24 //marker.showInfoWindow(); 25 26 }); 27 });
###質問したいこと
画像のパスは間違っていないのですが,表示がデフォルトの赤マーカのままでした.どのように設定すればマーカの画像を変更することができますか?

あなたの回答
tips
プレビュー