Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AngularGM no longer works with Oct. 11, 2015 update to 3.22 release of Google Maps API #83

Closed
jdkenney opened this issue Oct 13, 2015 · 5 comments

Comments

@jdkenney
Copy link

As in title:

AngularGM directive no longer works with the 3.22 (exp) update as of Oct. 11, 2015. The AngularGM demo page is also currently broken: http://dylanfprice.github.io/angular-gm/1.0.2/examples/#!/map/

Unfortunately the release notes (https://developers.google.com/maps/documentation/javascript/releases#322) for exp are only current to Sept. 22, 2015 so I'm not sure what changed in this update.

The problem is at least with changing the value of center in the gm-center attribute, although it seems like the initial location specified in gm-map-options is also ignored.

@frankcrisa
Copy link

I see this issue too.
Probably this issue is generated by the fact that since version 3.22 the pan control of the map is no longer available.
At the moment, the solution is to explicitly call version 3.21, that is the current "release" version. This version will change to "frozen" in November 2015 but it will removed on February 2016.

@frankcrisa
Copy link

I found the solution, the problem is with the object LatLng. With version 3.22 it was changed its structure and $scope.center = new google.maps.LatLng (lat, lng) is no longer executed.
It must be replaced with $scope.gmap.panTo(new google.maps.LatLng(lat, lng))
This is my simple_map.js for the demo at: http://dylanfprice.github.io/angular-gm/1.0.2/examples/#!/map/

angular.module('simple-map', ['AngularGM'])
.run(function (angulargmContainer, $rootScope) {
var gmapPromise = angulargmContainer.getMapPromise('simpleMap');
gmapPromise.then(function (gmap) {
// google map configuration here
$rootScope.gmap = gmap;
});
})
.controller('SimpleMapCtrl', function($scope) {
$scope.$watch('center', function(center) {
if (center) {
$scope.centerLat = center.lat();
$scope.centerLng = center.lng();
}
});

$scope.updateCenter = function(lat, lng) {
// $scope.center = new google.maps.LatLng(lat, lng);
$scope.gmap.panTo(new google.maps.LatLng(lat, lng));
};
});

@dylanfprice
Copy link
Owner

Great thanks @frankcrisa I will try to get a fix out this weekend.

On Wed, Nov 4, 2015 at 5:15 AM, frankcrisa notifications@github.com wrote:

I found the solution, the problem is with the object LatLng. With version
3.22 it was changed its structure and $scope.center = new
google.maps.LatLng (lat, lng) is no longer executed.
It must be replaced with $scope.gmap.panTo(new google.maps.LatLng(lat,
lng))
This is my simple_map.js for the demo at:
http://dylanfprice.github.io/angular-gm/1.0.2/examples/#!/map/

angular.module('simple-map', ['AngularGM'])
.run(function (angulargmContainer, $rootScope) {
var gmapPromise = angulargmContainer.getMapPromise('simpleMap');
gmapPromise.then(function (gmap) {
// google map configuration here
$rootScope.gmap = gmap;
});
})
.controller('SimpleMapCtrl', function($scope) {
$scope.$watch('center', function(center) {
if (center) {
$scope.centerLat = center.lat();
$scope.centerLng = center.lng();
}
});

$scope.updateCenter = function(lat, lng) {
// $scope.center = new google.maps.LatLng(lat, lng);
$scope.gmap.panTo(new google.maps.LatLng(lat, lng));
};
});


Reply to this email directly or view it on GitHub
#83 (comment)
.

@janhoffmann
Copy link

@frankcrisa works for me, thanks!

@dylanfprice
Copy link
Owner

I pushed a fix for this, which involved changing the contract of gm-center to deal in google.maps.LatLngLiteral objects instead of google.maps.LatLng objects. I'll go through the process of putting out a new version when I get another chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants