Greenstand/treetracker-web-map-core

Release web map core as a NPM module

dadiorchen opened this issue ยท 4 comments

We can not use/import the leaflet css when we installing the core to other project, like the treetracker-web-map-client next.js will throw error:

image

the reason:
https://nextjs.org/docs/messages/css-npm

Seems because we didn't import the bin/dist of the bundle, we directly import the src file in client, please figure out the correct way to install this package/lib to other clients.


Some hints:

  • Please read our readme for more information/guide/tutorial.
  • Here is an engineering book in Greenstand.
  • To know more about our organization, visit our website.
  • If you want to join the slack community (some resources need the community member's permission), please leave your email address.

import 'leaflet';
import 'leaflet/dist/leaflet.css';
import 'leaflet-utfgrid/L.UTFGrid';
import 'leaflet.gridlayer.googlemutant';

For a temporarily workaround, open the /node_modules/treetracer-web-map-core/src/Map.js and delete the line:

 import 'leaflet/dist/leaflet.css'; 

It might be necessary to delete the .next (if any) under the root folder to avoid caching

Then, paste the line above to the js file where we import the Map.js

I am working on a solution to this

๐ŸŽ‰ This issue has been resolved in version 1.0.0 ๐ŸŽ‰

The release is available on GitHub release

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€