I am using ngMap in angular for google map integration.
below are my html code
<map ng-transclude class='google-map' center="map.center">
<marker position="marker.position" options="marker.options"></marker>
</map>
my controller code is
//response get from server side
var onResponse = function(response){
$scope.workshop = response;
mapCenter(response.latitude, response.longitude);
};
function mapCenter(latitude, longitude) {
$scope.map = {
center: [latitude, longitude]
};
$scope.marker = {
position: [latitude, longitude],
options: function(){
return {
draggable: true
}
}
};
};
In this case map is display but center of map is not display properly it gets to the right side.
If I put below code outside function with dummy lat and long then it's working fine but I can't get dynamic lat and long value outside this function that's why I need to put this code in function.
$scope.map = {
center: [18.9750, 72.8258]
};
Please help me for solution.