Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6213

Polygon is not draggable

$
0
0

I drawn a polygon using MapboxGL.ShapeSource and added MapboxGLView.PointAnnotation on every point to make points draggable.

But i'm facing issues

When i finished the draw of Polygon, i'm not able to move or drag the polygon

 Polygon Data => {"coordinates": [[73.66673886505973, 21.78762724903116], [73.66889536107317, 21.791363112441147], [73.66555869310983, 21.79017760900554]]}

here my code

<MapboxGL.Animated.ShapeSource     id={'Polygon'}     maxZoomLevel={17}    onPress={(event: any) => {      console.log('Shape is pressed ', event);    }}    shape={{      type: 'Feature',      geometry: {        type: 'Polygon',        coordinates: coordinates,      },    }}><MapboxGL.FillLayer      id="routefill"      sourceID="Polygon"      style={{fillColor: fillColor}}    /><MapboxGL.LineLayer      id="routeline"      sourceID="Polygon"      belowLayerID="routefill"      style={{        lineWidth: 5,        // lineOpacity: 0.5,        lineJoin: 'round',        lineCap: 'round',        lineDasharray: [2, 2],        lineColor: strokeColor,      }}    /></MapboxGL.Animated.ShapeSource>

can anyone please help me how can i make polygon draggable


Viewing all articles
Browse latest Browse all 6213

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>