1

Please help! I'm doing everything according to the documentation, but it's in Kotlin. I need to display circles on the map.

I followed the prompts of the IDE, but the application crashes

AnnotationPlugin annotationAPI = AnnotationPluginImplKt.getAnnotations((MapPluginProviderDelegate)mapView);
CircleAnnotationManager circleAnnotationManager = CircleAnnotationManagerKt.createCircleAnnotationManager(annotationAPI, mapView);
CircleAnnotationOptions circleAnnotationOptions = new CircleAnnotationOptions()
        .withPoint(Point.fromLngLat(YOUR_LONG, YOUR_LAT))
        .withCircleRadius(8.0)
        .withCircleColor("#ee4e8b")
        .withCircleStrokeWidth(2.0)
        .withCircleStrokeColor("#ffffff");

circleAnnotationManager.create(circleAnnotationOptions);
mapView.getMapboxMap().loadStyleUri(Style.MAPBOX_STREETS);

1 Answers1

0

you can try this:

map1.addLayer({
        id: 'clusters',
        type: 'circle',
        source: 'earthquakes',
        filter: ['has', 'point_count'],
        paint: {
        'circle-color': 'rgba(110, 204, 57, 0.6)',
        'circle-radius': 20,
        'circle-stroke-width': 5,
        'circle-stroke-color': 'rgba(110, 204, 57, 0.4)'
        }
        });
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 19 '23 at 01:13