dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 164 forks source link

StrokeColor/StrokeWidth not working on IOS for Polygon hole #434

Closed dimitriospafos closed 3 years ago

dimitriospafos commented 3 years ago

Seems like "StrokeColor/StrokeWidth" is not working on IOS when having a hole in polygon. The strokeColor and strokeWidth apply correctly to the outer bounds of the polygon but not on the hole of the polygon.

var polygon = new Polygon();

        polygon.addPoints([ 
            Position.positionFromLatLng(-85.0511, -180),
            Position.positionFromLatLng(-85.0511, 0),
            Position.positionFromLatLng(-85.0511, 179.9999),
            Position.positionFromLatLng(85.0511, 179.9999),
            Position.positionFromLatLng(85.0511, 0),
            Position.positionFromLatLng(85.0511, -180)])

        polygon.addHole(getHole())

        polygon.visible = true;
                let argb = (75 << 24) | (100 << 16) | (100 << 8) | 100;
        polygon.fillColor = new Color(argb);

        polygon.strokeColor = new Color('#000000');
        polygon.strokeWidth = 5;
        this.mapView.addPolygon(polygon);

Attaching IOS and Android screenshots:

IMG_1959

Screenshot_20200923-204851_PeerPark

dimitriospafos commented 3 years ago

seems like this is caused because of the outer bounds of the polygon. if I change to:

polygon.addPoints([ 
            Position.positionFromLatLng(-85.0511, -170),
            Position.positionFromLatLng(-85.0511, 0),
            Position.positionFromLatLng(-85.0511, 179.9999),
            Position.positionFromLatLng(85.0511, 179.9999),
            Position.positionFromLatLng(85.0511, 0),
            Position.positionFromLatLng(85.0511, -170)])

then it works fine. Not sure why it behaves differently on android.