Hey
I just updated my ionic version (both the css and the bundle.js) to 1.0.0-beta.3. In use google maps in my application. When the user clicks on the map, a marker with a radius will be added:
All of this worked in the version i’ve used (v1.0.0-beta.1) until now. This is my template and js code:
Template:
<ion-content has-bouncing="true" padding="true" class="has-header has-tabs">
<div class="list card">
<div class="item">
<label class="item item-input">
<input name="name" type="text" placeholder="Name*" ng-model="info.name" required>
</label>
<div class="error" ng-show="addlocation_form.name.$dirty && addlocation_form.name.$invalid">
<small class="error" ng-show="addlocation_form.name.$error.required">
A name is required.
</small>
</div>
<label class="item item-input">
<input id="pac-input" class="controls" type="text" placeholder="Adress">
</label>
</div>
<div class="item item-body">
<div id="map-canvas-add-location"></div>
</div>
<div class="item">
<div class="range">
<i class="icon ion-minus-round"></i>
<input ng-model="info.radius" type="range" min="10" max="200" value="20">
<i class="icon ion-plus-round"></i>
</div>
</div>
</div>
</ion-content>
Javascript:
$scope.createMap = function () {
//Center default on Cronos
var lat = 51.142036;
var lng = 4.440966;
var mapOptions = {
zoom: 15,
center: new google.maps.LatLng(lat, lng),
disableDefaultUI: true
};
map = new google.maps.Map(document.getElementById('map-canvas-add-location'), mapOptions);
$scope.initializeCenter();
setListeners();
fixInfoWindow();
//Adress autocomplete
var input = /** @type {HTMLInputElement} */(document.getElementById('pac-input'));
$scope.adressAutocomplete = new google.maps.places.Autocomplete(input);
$scope.adressAutocomplete.bindTo('bounds', map);
};
google.maps.event.addDomListener(window, "load", $scope.createMap());
function setListeners() {
google.maps.event.addListener(map, 'click', function (event) {
checkIfAlreadyPresent();
$scope.placeMarker(event.latLng);
$scope.location = event.latLng;
});
}
Is there something I am doing wrong? Thanks in advance!