Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to use webglearth2-offline with .js file versus .html? #9

Open
chertik72 opened this issue Jan 3, 2020 · 0 comments

Comments

@chertik72
Copy link

I try to use it in .js component code with react as following:
import React from 'react'
import * as WE from 'webglearth2-offline-gh-pages/v2';

class FlightInfo extends React.Component {

componentDidMount() {
   this.initMap();
}

initMap() {
// Offline tiles
this.map = new WE.map('map');
this.map.setView([46.8011, 8.2266], 2);
WE.tileLayer('{z}/{x}/{y}.jpg', {
tileSize: 256,
bounds: [[-85, -180], [85, 180]],
minZoom: 0,
maxZoom: 16,
attribution: 'WebGLEarth example',
tms: true
}).addTo(this.map);
}

render() {
return(









)

When I am trying to run with CALL npm run dev I am receiving module not found error:

./src/components/flightInfo/FlightInfo.js
Module not found: Can't resolve 'webglearth2-offline-gh-pages/v2' in 'C:\heli-2020\tstWacs3Dbrancht\src\components\flightInfo'

Is there a way to resolve this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant