angularjs - Google map is not working in Angular App -
below code of google map not working in live application using angularjs.locally working.but when upload live app not working there.how solve this?
index.html
<div class="item item-divider" style="font-size:18px;"> <i class="icon ion-map"></i> <a ng-click="launchgooglemaps()">location map</a> </div>
app.js
$scope.launchgooglemaps=function(){ var url = "http://maps.google.com/maps?ll="+$scope.temple.latitude+","+$scope.temple.longitude; intel.xdk.device.launchexternal(url); }
try this
$scope.launchgooglemaps=function(){ var url = "http://maps.google.com/maps?ll="+$scope.temple.latitude+","+$scope.temple.longitude; document.addeventlistener("intel.xdk.device.ready",function(){ intel.xdk.device.launchexternal(url); },false); }
this function works inside event handlers. can’t call whenever to. make sure have added intel xdk device plugin in app.
and last not least should add line in config.xml
let app lunch external url: <access origin="*" />
ref: https://cordova.apache.org/docs/en/4.0.0/guide_appdev_whitelist_index.md.html
Comments
Post a Comment