lundi 26 juin 2017

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

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)




Aucun commentaire:

Enregistrer un commentaire