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..
Asked
Active
Viewed 394 times
1 Answers
2
There are quite a few examples of this on Stack Overflow, e.g.
Android Calling JavaScript functions in WebView
-
1Create 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 (https://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. – Ian Mar 17 '14 at 10:39