Worklight 7.1使用mapkit cordova插件打开本机地图应用程序

时间:2015-11-26 05:55:43

标签: android ios cordova google-maps mapkit

我正在使用工作灯开发混合应用程序我想用标记打开原生地图(适用于iOS的Apple地图和适用于Android的Google地图),然后在完成后返回应用程序。到目前为止,我已经实现了使用url打开本机地图,该地图在默认浏览器上打开本机地图。但我的要求是点击标记打开原生地图。

在谷歌期间,我找到了解决我问题的Mapkit cordova插件,但我不知道如何将Mapkit cordova插件与worklight集成。 如果有人知道mapkit与android和IOS的worklight集成,请帮助我。

*************** ******更新:***************************************** < / p>

经过大量的RnD,我发现下面的插件: phonegap-launch-navigator 。在worklight项目中安装cordova插件的配置如下:

启动原生地图的代码

launchnavigator.navigate(
          "London, UK",
          null,
          function(){
              alert("Plugin success");
          },
          function(error){
              alert("Plugin error: "+ error);
          });
Android config.xml中的

 <!-- android -->
  <platform name="android">
  <js-module src="www/default/js/launchnavigator.js" name="LaunchNavigator">
   <clobbers target="launchnavigator" />
   </js-module>
   <config-file target="res/xml/config.xml" parent="/*">
  <feature name="LaunchNavigator">
    <param name="android-package" value="android.LaunchNavigator"/>
  </feature>
  </config-file>
  <source-file src="src/android/LaunchNavigator.java" target-dir="src/com/hhMobileApp" />
  </platform>

java文件路径

  

天然\ SRC \机器人\ LaunchNavigator.java

js文件路径:

  

WWW \默认\ JS \ launchnavigator.js

在配置 phonegap-launch-navigator 插件后,获取以下错误。

  

错误:未捕获referenceError:模块未定义。

请建议您输入以解决此错误,以在Android中启动本机应用程序:

1 个答案:

答案 0 :(得分:1)

查看此链接: https://github.com/mapsplugin/cordova-plugin-googlemaps

你可以在config.xml中指定

插件,然后请点击链接。

您还可以创建自己的原生地图视图,并使用javascript中的WL.NativePage.show()调用它。