Hello,
I am a beginner, i created a project ‘tabs’ type and i wanted to show my maps in the page of account,but it didn’t shown up. .can you help me to solve the probleme please???
this is an article i work with it as a reference:
this is the important part of my code:
controllers.js
.controller('AccountCtrl', function($scope, $ionicLoading) {
google.maps.event.addDomListener(window, 'load', function() {
var myLatlng = new google.maps.LatLng(37.3000, -120.4833);
var mapOptions = {
center: myLatlng,
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
navigator.geolocation.getCurrentPosition(function(pos) {
map.setCenter(new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude));
var myLocation = new google.maps.Marker({
position: new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude),
map: map,
title: "My Location"
});
});
$scope.map = map;
});
});
tab-account.html
<ion-view view-title="Account">
<ion-content>
<div id="map" data-tap-disabled="true"></div>
</ion-content>
</ion-view>
as for the others things are like the article.(i already tryed the code in a “blank” project and it did work)