Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Draw circle with latitude , longitude and radius #16632

Open
miladsalimiiii opened this issue Dec 14, 2021 · 0 comments
Open

Draw circle with latitude , longitude and radius #16632

miladsalimiiii opened this issue Dec 14, 2021 · 0 comments

Comments

@miladsalimiiii
Copy link

I want to draw circle with latitude , longitude and radius i used this issue and implement these codes :

                Feature singleFeature = Feature.fromGeometry(Point.fromLngLat(drawCircleCommand.latitude,drawCircleCommand.longitude));
                FeatureCollection featureCollection2 = FeatureCollection.fromFeatures(Arrays.asList(singleFeature));


                GeoJsonSource geoJsonSource = new GeoJsonSource("source-id", featureCollection2);

                mapboxMap.getStyle().addSource(geoJsonSource);

                CircleLayer circleLayer = new CircleLayer("layer-id", "source-id");

                circleLayer.withProperties(
                        PropertyFactory.circleRadius(drawCircleCommand.radius.floatValue()),
                        PropertyFactory.circleOpacity(10f),
                        PropertyFactory.circleColor(drawCircleCommand.fillColor),
                        PropertyFactory.circleStrokeColor(drawCircleCommand.strokeColor)
                );

                mapboxMap.getStyle().addLayer(circleLayer);

But when i run the app i dont have any circle.

So my first question is why?
And my second question is what are these "source-id" and "layer-id" and how can i fill them?

Platform: Android
Mapbox SDK version: 8.6.3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant