I have been trying to get angular-google-maps up and running and for the life of me i cannot firgure out why it is not working...
first i install the
cordova plugin add cordova-plugin-geolocation
here is the index html
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- google maps javascript -->
<script src='//maps.googleapis.com/maps/api/js?sensor=false'></script>
<script src="lib/lodash/dist/lodash.min.js"></script>
<script src="lib/angular-google-maps/dist/angular-google-maps.min.js"></script>
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/controllers.js"></script>
<script src="js/services.js"></script>
</head>
my map.html
<ion-view view-title="Map">
<ion-content ng-controller="MapCtrl">
<ui-gmap-google-map center='map.center' zoom='map.zoom'></ui-gmap-google-map>
</ion-content>
</ion-view>
and finally my module and controller
var myApp = angular.module('myApp', ['ionic','uiGmapgoogle-maps']);
myApp.controller('MapCtrl', function($scope) {
$scope.map = { center: { latitude: 45, longitude: -73 }, zoom: 8 };
});
when this is run a get a blank screen on both chrome browser and on android phone.. any ideas what i may be doing wrong?? thanks for looking
so after moving google dependencies below ionic.bundle the map now loads... however i cannot set height to 100% using
.angular-google-map-container {
height: 100%;
}
any ideas??
Try this.
<map center="{{latitud}}, {{longitud}}" zoom="12" id="map_views" data-tap-disabled="true"></map>
<script src="lib/angular-google-maps/dist/angular-google-maps.min.js"></script>
shall be loaded AFTER ionic
as ionic bundle includes angular Framework