2
  1. I was trying to implement PolygonFeature in map but could not do it in a fashion I am adding PointFeature. It does not display the Polygon in the map.
  2. I also tried examples Draw a Polygon and Draw a polygon with holes but they are using APIs that at least seem unavailiable in theversion 6.7.0

Example :

style.addSource()
style.addLayer() 

These methods are not available in style of OnStyleLoadedListener which seems to be String type And Style.OnStyleLoaded is not available in the APIs either (which is being used in the example)

style.addSource()
style.addLayer() 

are available on MapBoxMap but that does not render the polygon in the screen.

Are there any working examples or guide to render Polygon in Mapbox?

halfer
  • 19,824
  • 17
  • 99
  • 186
erluxman
  • 18,155
  • 20
  • 92
  • 126

1 Answers1

0

Caveat: if you are starting from scratch, I would definitely recommend using +v7.x if possible. It includes several performance and bug fixes that you won't get from older versions.

If you absolutely need to reference an example of adding a Polygon with older versions of the API, you can see this by referencing historical commits to the 'master' branch of the Mapbox Android Demo App, which is where the website's example code is pulled from.

For example, here's the 6.7.0 version of Draw a Polygon.


⚠️ Disclaimer: I currently work for Mapbox ⚠️

riastrad
  • 1,624
  • 10
  • 22