{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from ipyleaflet import Map, basemaps, PMTilesLayer" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "m = Map(center=[52.963529, 4.776306], zoom=7, basemap=basemaps.CartoDB.DarkMatter, scroll_wheel_zoom=True)\n", "m.layout.height = '600px'\n", "\n", "vl = PMTilesLayer(url=\"https://storage.googleapis.com/ahp-research/overture/pmtiles/overture.pmtiles\",\n", " style = {\n", " \"layers\": [\n", " {\n", " \"id\": \"admins\",\n", " \"source\": \"example_source\",\n", " \"source-layer\": \"admins\",\n", " \"type\": \"fill\",\n", " \"paint\": {\"fill-color\": \"#BDD3C7\", \"fill-opacity\": 0.1},\n", " },\n", " {\n", " \"id\": \"buildings\",\n", " \"source\": \"example_source\",\n", " \"source-layer\": \"buildings\",\n", " \"type\": \"fill\",\n", " \"paint\": {\"fill-color\": \"#FFFFB3\", \"fill-opacity\": 0.5},\n", " },\n", " {\n", " \"id\": \"places\",\n", " \"source\": \"example_source\",\n", " \"source-layer\": \"places\",\n", " \"type\": \"fill\",\n", " \"paint\": {\"fill-color\": \"#BEBADA\", \"fill-opacity\": 0.5},\n", " },\n", " {\n", " \"id\": \"roads\",\n", " \"source\": \"example_source\",\n", " \"source-layer\": \"roads\",\n", " \"type\": \"line\",\n", " \"paint\": {\"line-color\": \"#FB8072\"},\n", " },\n", " ],\n", " })\n", "m.add(vl)\n", "m" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.5" } }, "nbformat": 4, "nbformat_minor": 4 }