How to use RouteBoxer.js for Google Map on Android

蹲街弑〆低调 提交于 2019-12-23 08:36:52

问题


I have a route. Now, I want to find all nearby markets, for example, around that route. On web version, I use RouteBox library successfully. The problem is I can't use it in Google Map on Android, because it is a javascript library.

What can I do now? How can I use that library on Android or do I have a workaround way?


回答1:


You can call javascript from your App in Android. You will need to use JS Evaluator for Android (JSEA).

Just do something like:

jsEvaluator.callFunction(new JsCallback() {
  @Override
  public void onResult(final String result) {
    // get result here
  }
}, "functionName", "parameter 1", "parameter 2", 912, 101.3);

To call your javascript.

So, you can access the library that will allow you communicate your App with the RouteBoxer API. Just check it on Github for JSEA. It should allow you to use RouteBoxer as usual.

Hence, you will call the route from your App.




回答2:


As an alternative, you can also use a Java port of the RouteBoxer.js available here: https://code.google.com/p/routeboxer-java/



来源:https://stackoverflow.com/questions/23060477/how-to-use-routeboxer-js-for-google-map-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!