0

While implementing Google Maps in android using API V3(Javascript) How do i pass values from activity to the javascript? ie.. i want to pass the Latitude and Longitude values to Javascript inorder to display my current location on map..

1 Answer 1

2

There are quite a few examples of this on Stack Overflow, e.g.

Android Calling JavaScript functions in WebView

Calling javascript function from android webview?

Call javascript function in Android WebView

Sign up to request clarification or add additional context in comments.

1 Comment

Create a function in your JavaScript called, say, showLocation which has 2 parameters (one for latitude, one for longitude). This function just needs to create a new point and add it to the map. Google's documentation for the Maps JavaScript SDK contains examples on how to do this (developers.google.com/maps/documentation/javascript). Then, in your Java code, call your new "showLocation" JS function, the StackOverflow posts in my answer show you how to do this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.