oscarfonts / mapbox-gl-cordova-offline

Offline vector maps in Cordova using Mapbox GL JS
Other
60 stars 37 forks source link

Will this work with geojson data? #18

Closed thsbrown closed 6 years ago

thsbrown commented 6 years ago

Right now I currently have geojson being loaded offline using the below code. I'm using Ionic and up until production build everything had been working flawlessly, i'm hoping your plugin could help me out 👍 .

    this.map.addSource(this.STATES_SOURCE_ID, {
      type: "geojson",
      data: "/assets/data/map/us-states.geojson"
    });

Will this plugin work for this data type as well?

Thanks in advance!

oscarfonts commented 6 years ago

You can read geojson data directly with mapboxgl, no need for this plugin. Just use an absolute path (starting with file:/// if it's a local resource).

This plugin is for reading local vector .mbtiles files.

thsbrown commented 6 years ago

Awesome I actually was able to stumble into that. My file path was incorrect. Thanks for you time!