Telerik-Verified-Plugins / Mapbox

Native OpenGL maps for your Cordova app
112 stars 52 forks source link

Not able to import mapbox-gl npm package and cordova-plugin-mapbox #80

Closed CactimediaGitHub closed 7 years ago

CactimediaGitHub commented 7 years ago

How to import mapbox-gl npm package in cordova application?

const mapboxgl1 = require('mapbox-gl/dist/mapbox-gl.js'); mapboxgl1.accessToken = 'pk.eyJ1IjoibGF2by1jYWN0aW1lZGlhIiwiYSI6ImNqNGU3bjhsZzBrbHoycW1rZWxod290ZHYifQ.xof4oeDjbexECuTyqdkewQ'; const map = new mapboxgl1.Map({ container: 'map-test', style: 'mapbox://styles/mapbox/streets-v10' });

This is giving an error as - Uncaught Error: Could not find module mapbox-gl/dist/mapbox-gl.js imported from (require)

Please mention the steps to import this.

cusspvz commented 7 years ago

This is not an issue from this plugin. But yet, you can include the mapbox-gl dist as a script on the html.