cordova - Android 4.2.2 does not load google maps for my application -
I'm developing an Android application (build with PhoneGap) for which the user's current location is displayed and the KMZ file Loading is required on Google Maps (with poly lines) (use Google Map API).
My application loads the map at specific zoom level (11) and focuses the map on the basis of the user's current location (reducing data consumption). . I have noticed that the map for Android OS 4.2.2 has not been loaded at all, the message "Displaying its current status denied" message has been displayed.
On the other side, the map OS is properly loaded for OS 4.1.2, 4.3, 4.4 (no messages received).
Is this a security problem / bug for Android 4.2.2? Or is it a bug related to Phonebap that I use to create an APK?
How can I resolve this issue? Do I have any configuration in mobile?
Thanks
It works fine on Android 4.2.2 or any other supported version It may be a mistake in your code setting.
(1) In the HTML header section Step Include Google API Key and map JS link (2) Declare the following function to present the file in the index.js file (3) Add permission to the AndroidManifest.xml file. (4) Set up your project For example, run the app on 4.2.2 (5) device and it has three different types of map views (Road, Street And live traffic).
& Lt; Meta name = "format-address" content = "telephone = no" /> & Lt; Meta name = "msapplication-tap-highlight" content = "no" /> & Lt; Meta name = "viewport" content = "width = device-width, height = device-height" /> & Lt; Link rel = "stylesheet" type = "text / css" href = "css / index.css" /> & Lt; Script type = "text / javascript" src = "https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_VALUE_&sensor=true" & gt; & Lt; / Script & gt; & Lt; Title & gt; Hello World & lt; / Title & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; B & gt; Road View & lt; / B & gt; & Lt; Div id = "map-canvas" style = "width: 100%; height: 200px" & gt; & Lt; / Div & gt; & Lt; B & gt; Street View & lt; / B & gt; & Lt; Div id = "pano" style = "width: 100%; height: 200px;" & Gt; & Lt; / Div & gt; & Lt; B & gt; See live traffic updates & lt; / B & gt; & Lt; Div id = "traffic" style = "width: 100%; height: 200px;" & Gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" src = "cordova.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "js / index.js" & gt; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt;
Var app = {start: function () {this.bindEvents (); }, Bind Aventus: function () {document.addEventListener ('deviceready', this.onDeviceReady, false); }, OnDeviceReady: function () {app.receivedEvent ('deviceready'); App.renderMap (); }, Receive event: function (id) {}, rendermap: function () {// view road var fenway = new google.maps.LatLng (42.345573, -71.098326); Var mapOptions = {center: fenway, zoom: 11}; Var map = new google.maps.Map (document.getElementById ('map-canvas'), map options); // ---- Street View var Panorama options = {place: Phenway, POV: {top: 34, pitch: 10}}; Var Panorama = New google.maps.StreetViewPanorama (document.getElementById ('Pano'), Panorama options); Map.setStreetView (panorama); // ---- Watch Live Traffic var myLatlng = new google.maps.LatLng (34.04924594193164, -118.24104309082031); Var map option = {zoom: 13, center: myLatlng} var map = new google.maps.Map (document.getElementById ('traffic'), map options); Var traffic level = new google.maps.TrafficLayer (); TrafficLayer.setMap (map); }}; App.initialize ();
Comments
Post a Comment