JKo*_*der 10 google-maps angularjs angular-google-maps
我无法创建自定义标记.即使我将图像路径传递给icon参数,我仍然会获得默认的橙色标记.如果你看错了,请告诉我.
指令的模板:
<div id="searchMap" class="googleMaps-destinations">
<div class="google-maps">
<ui-gmap-google-map center="map.center" zoom="map.zoom" options="map.options">
<ui-gmap-marker
ng-repeat="marker in search.origin_airports"
coords="marker.originMarker.location"
icon="marker.originMarker.icon.url"
fit="false"
idkey="'<< marker.originMarker.id >>'" >
</ui-gmap-marker>
</ui-gmap-google-map>
</div>
Run Code Online (Sandbox Code Playgroud)
我正在使用://maps.googleapis.com/maps/api/js?v=3&sensor=true with angular-google-maps/dist/angular-google-maps.js
JKo*_*der 14
错过了该图标是一个对象.
icon= '{url: "//developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png" }'
Run Code Online (Sandbox Code Playgroud)
小智 14
我通过options属性解决了传递图标的URL
在控制器上设置这样的东西
marker.options: {
icon:'//developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png"'
}
Run Code Online (Sandbox Code Playgroud)
然后
<div id="searchMap" class="googleMaps-destinations">
<div class="google-maps">
<ui-gmap-google-map center="map.center" zoom="map.zoom" options="map.options">
<ui-gmap-marker
options="marker.options"
ng-repeat="marker in search.origin_airports"
coords="marker.originMarker.location"
fit="false"
idkey="'<< marker.originMarker.id >>'">
</ui-gmap-marker>
</ui-gmap-google-map>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
17461 次 |
| 最近记录: |