phonegap-googlemaps-plugin in ionic,icon image not working [英] phonegap-googlemaps-plugin in ionic, icon image not working

查看:164
本文介绍了phonegap-googlemaps-plugin in ionic,icon image not working的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将本地存储在设备上的图像用作标记图标?我可以使用URL并且它可以工作,但是当我尝试使用本地图像时,它将无法加载。我应该如何参考图像?

Is it possible to use an image locally stored on the device as the marker icon? I can use a URL and it works, but when I try to use a local image it won't load. How should I reference the image?

map.addMarker({
    'position': new plugin.google.maps.LatLng(13.7579507,100.5643353),
    'title': 'Fortune Town',
    'icon': 'img/icon.png'
}, function(marker) {
    marker.showInfoWindow();
});

将Ionic Framework和Cordova与来自 https://github.com/wf9a5m75/phonegap-googlemaps-plugin/

Using Ionic Framework and Cordova with the Google Maps plugin from https://github.com/wf9a5m75/phonegap-googlemaps-plugin/

已经提到
Cordova / Phonegap谷歌地图插件上的标记图标的本地图像
并尝试图标:www / img / icon.png,但是这个不起作用。

Already referred to Local image for marker icon on Cordova/Phonegap Google Maps Plugin and tried icon:"www/img/icon.png", but this doesn't work.

推荐答案

插件是为cordova4编写的,当使用cordova5运行时,privateInitialize方法调用不正确

Plugin was written for cordova4 , when running with cordova5 , privateInitialize method is not called properly

有些人Cosmith已经修复了

some guy Cosmith already fixed that

参考链接:

https://github.com/wf9a5m75/phonegap-googlemaps-plugin/issues/ 537个

https ://github.com/cosmith/phonegap-googlemaps-plugin#bugfix/icon-crash-cordova-5 - 变量API_KEY_FOR_ANDROID =API_KEY - 变量API_KEY_FOR_IOS =API_KEY

https://github.com/cosmith/phonegap-googlemaps-plugin#bugfix/icon-crash-cordova-5 --variable API_KEY_FOR_ANDROID="API_KEY" --variable API_KEY_FOR_IOS="API_KEY"

^无论如何感谢帮助人

^anyways thanks for help guys

这篇关于phonegap-googlemaps-plugin in ionic,icon image not working的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆