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
There are quite a few examples of this on Stack Overflow, e.g.
Android Calling JavaScript functions in WebView
1 Comment
Ian
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.