tombatossals / angular-openlayers-directive

AngularJS directive to embed an interact with maps managed by the OpenLayers library
http://tombatossals.github.io/angular-openlayers-directive/
MIT License
282 stars 183 forks source link

Mapbox not working with json #366

Closed tatianass closed 7 years ago

tatianass commented 7 years ago

I made my own map at mapbox studio and download it. But when I follow example 40, there's an error saying wrong formation. When I opened mapbox.geography-class.json, I could check that the file is very different from the json that I downloaded from mapbox website. So, how can I convert my json for the one that is working or there's another way to make it work?

tatianass commented 7 years ago

I found the answer:

  1. In the mapbox studio go to Styles;
  2. On your map menu go to Share, develope & use;
  3. Go to Develop with this style and choose Leaflet;
  4. Copy the text and paste it:
                        name: 'MapBox Night',
                        active: false,
                        source: {
                            type: 'XYZ',
                            url: 'https://api.mapbox.com/styles/v1/tatianass/cj28xs19900002rpatmcj4i7g/tiles/256/{z}/{x}/{y}?access_token=<your key>'
                        }
                    }