Code Monkey home page Code Monkey logo

Comments (5)

openSourcerer9000 avatar openSourcerer9000 commented on May 9, 2024

More specifically, for example, how does one import and use MlLayerSwitcher? I assume this is a legend control component?

import {
  MlLayerSwitcher,
  MapLibreMap,
  MlNavigationTools,
  MlGeoJsonLayer,
  useMap,
} from "@mapcomponents/react-maplibre";
index.js:1 ./src/App.js
Attempted import error: 'MlLayerSwitcher' is not exported from '@mapcomponents/react-maplibre'.

from react-map-components-maplibre.

cioddi avatar cioddi commented on May 9, 2024

Hi @openSourcerer9000 thank you for your messages.
Sadly we got some problems with our codesandbox templates since maplibre-gl switched to Typescript it is no longer possible to install npm modules that use maplibre-gl as a dependency. We are looking for a fix, it appears to be something related to the way maplibre-gl has integrated the service-worker code within the npm module.

The MlLayerswitcher component is not yet exported by the module since it is still experimental.

I recommend our storybook for browsing through existing components (I see you are using that already) https://mapcomponents.github.io/react-map-components-maplibre

And using our create-react-app template to get started with developing a project.

npx create-react-app@latest app_name --template=@mapcomponents/cra-template

I will give a more detailed answer in the other issue you opened.
We are working on the documentation. The important components have a quite complete documentation of attributes (e.g. https://mapcomponents.github.io/react-map-components-maplibre/?path=/docs/mapcomponents-mlgeojsonlayer--linestring). Other components are poorly or not documented yet, usually ones that are still in a proof of concept stage. We are aiming to overhaul the documentation especially regarding an easy entry soon.

from react-map-components-maplibre.

chris-aeviator avatar chris-aeviator commented on May 9, 2024

The storybooks don't provide much help - they show settings without showing the underlying code.

from react-map-components-maplibre.

cioddi avatar cioddi commented on May 9, 2024

The storybook and catalogue are still work in progress.

The storybook is currently providing documentation for component attributes on the docs tab.
Though the code samples shown in the docs tab are sometimes unrelated since they sometimes show the decorator code for component stories instead of the actual story code. Also the documentation of important hook such as useMap is missing in there. We'll fix that and get back to you.

from react-map-components-maplibre.

cioddi avatar cioddi commented on May 9, 2024

We have improved the documentation a lot, although it is not complete yet.
The code examples in the storybook docs tab have been improved on most components to show more relevant code.

I will close this issue for now, still we are determined to constantly improve the documentation and make the project as accessible as possible.

from react-map-components-maplibre.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.