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

No ol/layer/WebGLPoints found in the packaged code #11735

Closed
mylove10086 opened this issue Nov 11, 2020 · 6 comments
Closed

No ol/layer/WebGLPoints found in the packaged code #11735

mylove10086 opened this issue Nov 11, 2020 · 6 comments
Labels

Comments

@mylove10086
Copy link

You can use the source code
import WebGLPointsLayer from'ol/layer/WebGLPoints';
To use WebGLPointsLayer;
But WebGLPoints cannot be used in the packaged code
var vectorSource = new ol.source.Vector({
attributions:'NASA',
});
var wgl = new ol.layer.WebGLPoints({
style: style,
source: vectorSource,
disableHitDetection: true,
});
ol.layer.WebGLPoints is undefined.
But the export has been seen in src/ol/layer.js.
Why is this

@mike-000
Copy link
Contributor

@ahocevar
Copy link
Member

Please don't use the above URLs directly in your applications. If you really need them, download and host them locally.

@dmatranga
Copy link

I also had this issue when using the packaged code for the workshop, and received the error:

...Uncaught TypeError: ol_layer__WEBPACK_IMPORTED_MODULE_4__.WebGLPoints is not a constructor

@ahocevar
Copy link
Member

The workshop uses the ol package, so this is probably an unrelated issue.

@Gtrouborst
Copy link

Gtrouborst commented Jan 6, 2021

I also had this issue when using the packaged code for the workshop, and received the error:

...Uncaught TypeError: ol_layer__WEBPACK_IMPORTED_MODULE_4__.WebGLPoints is not a constructor

I cannot judge whether this is an unrelated issue, but I solved it by changing the import line.

from:

import {WebGLPoints as WebGLPointsLayer} from 'ol/layer';

to:

import WebGLPointsLayer from 'ol/layer/WebGLPoints';

It looks like the original import line creates an alias for a constructer that doesn't exist (anymore). However, the suggested alias is itself a valid constructer.

@stale
Copy link

stale bot commented Jun 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 9, 2021
@stale stale bot closed this as completed Jun 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants