While working on my project, I successfully integrated Google Maps. However, I have encountered a problem: when I search for a specific location, the marker is not displaying at the correct point, but rather somewhere else. The latitude and longitude values are accurate, so I'm unsure of what I may be missing. Can you provide assistance in helping me understand this issue?
Note: Interestingly, for some locations, the marker is displayed correctly.
This is the HTML code snippet:
<input ng-model="address" class="form-control" ng-map-autocomplete/>
<ng-map zoom="18" center="{{address}}" style="width:650px; height:450px">
<marker position="{{address}}" title="{{address}}" draggable="true"></marker>
</ng-map>
And here is the controller code section:
$scope.$watch(function ($scope) { return $scope.chosenPlaceDetails }, function () {
if (angular.isDefined($scope.chosenPlaceDetails )) {
$scope.latitude= $scope.chosenPlaceDetails.geometry.location.lat();
$scope.longitude=$scope.chosenPlaceDetails.geometry.location.lng();
}
});