Hi Everyone,
Until the mapview becomes available, I have managed to "squeeze" the googlemaps V3 JS API into a webview for an app I am working on :sign0060:
The benefit of the JS map over a static map is complete scrolling etc.
To give back to the community here is the code. All the code does is generate the HTML & javscript code to generate the maps !
I will create a mod if anyone is interested.
You will need an activity with a webview. I have set my webview in code to 100%x, 100%y
Neil
Until the mapview becomes available, I have managed to "squeeze" the googlemaps V3 JS API into a webview for an app I am working on :sign0060:
The benefit of the JS map over a static map is complete scrolling etc.
To give back to the community here is the code. All the code does is generate the HTML & javscript code to generate the maps !
I will create a mod if anyone is interested.
You will need an activity with a webview. I have set my webview in code to 100%x, 100%y
B4X:
Dim MapWebView as Webview
Dim Lat as Float
Dim Long as Float
Dim HtmlCode as String
Lat = -34.397 'Replace these with your app data
Long = 150.644
activity.addnew(MapWebView,0,0,100%x,100%y)
HtmlCode = "<!DOCTYPE html><html><head><meta name='viewport' content='initial-scale=1.0, user-scalable=no' /><style type='text/css'> html { height: 100% } body { height: 100%; margin: 0px; padding: 0px }#map_canvas { height: 100% }</style><script type='text/javascript' src='http://maps.google.com/maps/api/js?sensor=true'></script><script type='text/javascript'> function initialize() { var latlng = new google.maps.LatLng(" & Lat & "," & Long & "); var myOptions = { zoom: 16, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById('map_canvas'), myOptions); var marker0 = new google.maps.Marker({ position: new google.maps.LatLng(" & Lat & "," & Long & "),map: map,title: '',clickable: false,icon: '' }); }</script></head><body onload='initialize()'> <div id='map_canvas' style='width:100%; height:100%'></div></body></html>"
webview1.LoadHtml(HTML_Code)
Neil