Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use RouteBoxer.js for Google Map on Android

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?

like image 932
Triet Doan Avatar asked Apr 14 '14 12:04

Triet Doan


People also ask

Is Google maps written in JavaScript?

Google API is Javascript. It is also available in Flash. Bing map is using the same sytem and it is available in javascript or silverlight. You may also be interested in openstreetmap (free alternative).

Does Google Maps use jQuery?

google-places. js is a jQuery plugin which displays Google Places data (currently only reviews) on the page using Google Map's Places API.


2 Answers

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.

enter image description here

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.

enter image description here

Hence, you will call the route from your App.

like image 105
Avanz Avatar answered Sep 30 '22 18:09

Avanz


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

like image 22
Virat Singh Avatar answered Sep 30 '22 18:09

Virat Singh