angular-google-maps
angular-google-maps copied to clipboard
'fit' doesn't work for polylines
fit="true"
on a ui-gmap-polyline
doesn't seem to work. The polyline is rendered but the map displays at it's initial centre and zoom level.
Am I doing this correctly?
<ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="options">
<ui-gmap-polyline path="path.coords" stroke="path.stroke" static="true" fit="true"></ui-gmap-polyline>
</ui-gmap-google-map>
$scope.map = {center: {latitude: 40.1451, longitude: -99.6680 }, zoom: 12};
$scope.path = {
coords: [
{
latitude: 45,
longitude: -74
},
{
latitude: 30,
longitude: -89
},
{
latitude: 37,
longitude: -122
},
{
latitude: 60,
longitude: -95
}
],
stroke: {
color: '#1083A0',
opacity: 1,
weight: 5
}
Here's a plunkr
I have the same problem, has anyone found a solution?
The same issue, it does not work also for polygones
Same here