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..

Rashid
  • 492
  • 8
  • 19

1 Answers1

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

Community
  • 1
  • 1
Ian
  • 7,090
  • 2
  • 43
  • 51
  • 1
    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 (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