Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

import as node module fails #1667

Closed
geraldo opened this issue Sep 19, 2022 · 2 comments
Closed

import as node module fails #1667

geraldo opened this issue Sep 19, 2022 · 2 comments

Comments

@geraldo
Copy link
Contributor

geraldo commented Sep 19, 2022

I try to build the most basic maplibre example as node module, but without success. What am I doing wrong?

import * as maplibregl from "maplibre-gl";

var map = new maplibregl.Map({
    container: 'map', // container id
    style: 'https://demotiles.maplibre.org/style.json', // style URL
    center: [0, 0], // starting position [lng, lat]
    zoom: 1 // starting zoom
});

This throws this error:

TypeError: maplibregl.Map is not a constructor

Or is this not working yet, because related to #1595?

@HarelM
Copy link
Collaborator

HarelM commented Sep 19, 2022

Have you tried import maplibre from "maplibre-gl"?
It probably depends on the packaging system and all kind of other javascript toolings...
You can take a look at the examples to see that this works as expected in plain javascript + html...

@HarelM
Copy link
Collaborator

HarelM commented Sep 19, 2022

Since I don't think this is a real issue I'm converting it to a discussion.

@maplibre maplibre locked and limited conversation to collaborators Sep 19, 2022
@HarelM HarelM converted this issue into discussion #1668 Sep 19, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants