Git Product home page Git Product logo

Comments (4)

giswqs avatar giswqs commented on May 14, 2024 1

I am aware of PMTiles. I tried to use it before. See the relevant issues below. I am not a JavaScript user, and I am not capable of making it work at the moment. Contrbutions are welcome.

protomaps/PMTiles#209
widgetti/ipyreact#44

from mapwidget.

daniel-fink avatar daniel-fink commented on May 14, 2024

Thanks for the response. I am also not proficient at JS. Forgive my naivety, but this example looks like it simply enables pmtiles to be added to a maplibre map via loading a JS library in an HTML page:
https://github.com/protomaps/PMTiles/blob/main/js/examples/maplibre.html#L7C36-L7C36, and the content is specified in line 24 of the <script> tag: let PMTILES_URL = "https://protomaps.github.io/PMTiles/protomaps(vector)ODbL_firenze.pmtiles";

Is there a way to also enable loading the pmtiles JS Library within the MapLibre MapWidget? I am OK with the tile content needing to be loaded from a (local or remote) webserver. The idea is I could specify this content in a string used in the .set_esm() method

from mapwidget.

giswqs avatar giswqs commented on May 14, 2024

You can try modifying the js code in this file to see if it works.
https://github.com/opengeos/mapwidget/blob/master/mapwidget/javascript/maplibre.js

from mapwidget.

daniel-fink avatar daniel-fink commented on May 14, 2024

For future readers: I couldn't manage to accomplish this via mapwidget. I did succeed however in simply iframe-ing a local .html --

%%html
<iframe src="EXAMPLE.html" width="1200" height="600"></iframe>

Where the local .html is constructed similar to the Maplibre PMTiles example (https://github.com/protomaps/PMTiles/blob/main/js/examples/maplibre.html)

from mapwidget.

Related Issues (8)

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.