Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
335 views
in Technique[技术] by (71.8m points)

reactjs - How make a Geojson Layer draggable using React-Map-GL in React?

I am having a GeoJson data and I am displaying it in map using Source and Layer using React-Map-GL, now I want to relocate the position by dragging but I dont know how to do in React? and this is my code

<Source
  id={'pointData'}
  type={'geojson'}
  data={this.state.markerData}
>
  <Layer
    id={'circleLayer'}
    source={'pointData'}
    type={'circle'}
    paint={{
    'circle-radius': 6,
    'circle-color': ['get', 'icon-color'],
    'circle-stroke-width': 1,
    'circle-stroke-color': '#fff',
    'circle-stroke-opacity': 1
    }}
    />
      <Layer
         id={'pointLayer'}
         source={'pointData'}
         type={'symbol'}
         layout={{
           'icon-image': ['get', 'icon-symbol'],
           'icon-size': ['get', 'icon-size'],
           'icon-allow-overlap': true,
           'icon-ignore-placement': true
         }}
         paint={{
           'icon-opacity': 1
         }}
    /> 
</Source>

Can any help me here?

question from:https://stackoverflow.com/questions/65933679/how-make-a-geojson-layer-draggable-using-react-map-gl-in-react

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...