Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add circles using Point and Polygon with JSX syntax #107

Open
ok-AK opened this issue Jan 12, 2022 · 1 comment
Open

How to add circles using Point and Polygon with JSX syntax #107

ok-AK opened this issue Jan 12, 2022 · 1 comment
Labels
question Further information is requested

Comments

@ok-AK
Copy link

ok-AK commented Jan 12, 2022

Ask:
Specifically I want to do this:
https://docs.microsoft.com/en-us/azure/azure-maps/map-add-shape#add-a-circle-to-the-map

I want a geospatially correct circle as the user zooms in and out.

Alternatives I've tried:
Bubble layer gets me a circle but the radius is pixel fixed which is why I discarded this approach and want to get the above point/shape + Polygon layer combo working.

Question:
It is not clear to me where to apply properties subType and radius when using the JSX components offered by this library.

I tried something like this where I specify type as a point and variant as shape. Then I add subType and radius to properties. This did not work and nothing from this layer shows up on the map.

Is this on the right track and if so, what is missing in order to render a point as a geospatially correct circle?

myPoints

<AzureMapFeature
  key={id}
   id={id}
   variant="shape"
   type="point"
   coordinates={[new Position(0, 0)]}
   properties={{
       subType: 'Circle',
       radius: 10000 //meters
     }}
 />

Later I create a PolygonLayer like this
myPolygonLayer

<AzureMapLayerProvider
  id={`${layerId}-polygonLayer-circles`}
  options={{
    fillOpacity: 0.75,
    fillColor: 'red',
  }}
  type="PolygonLayer"
  events={eventsHandlers}
/>

Finally I create a DataSource provider like this with the above two JSX components
DataSource

<AzureMapDataSourceProvider id={layerId}>
  {myPolygonLayer}
  {myPoints}
</AzureMapDataSourceProvider>

Thanks!

@dubiety dubiety added the question Further information is requested label Jun 18, 2022
@nbrysondev
Copy link

I've come across this issue too. The azure maps documentation says that this should be possible (https://learn.microsoft.com/en-us/azure/azure-maps/map-add-shape). Is the circle subtype not implemented in this library?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants