Closed CactimediaGitHub closed 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.
This is not an issue from this plugin. But yet, you can include the mapbox-gl dist as a script on the html.
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.