angular-google-maps icon indicating copy to clipboard operation
angular-google-maps copied to clipboard

'fit' doesn't work for polylines

Open 3rror404 opened this issue 7 years ago • 3 comments

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

3rror404 avatar Aug 23 '16 16:08 3rror404

I have the same problem, has anyone found a solution?

holaontiveros avatar Aug 29 '16 13:08 holaontiveros

The same issue, it does not work also for polygones

pustun avatar Sep 06 '16 12:09 pustun

Same here

ashfaq-ahmed avatar Dec 25 '16 18:12 ashfaq-ahmed