I have placed 10 geopackage files locally on GeoServer. I also added a plugin for vector tiles. Tell me the code to open them via Leaflet and that when you click on the object there is information.
-
I have a few geojson examples but not a geopackage. They are similar but the leaflet site has a better example. – Cary H Sep 16 '20 at 19:21
-
The example you are looking for may be here. gis.stackexchange.com/questions/202165/… – Cary H Sep 16 '20 at 19:24
-
@CaryH The example you are referring to in your comment is for OpenLayers, not for Leaflet. – TomazicM Sep 16 '20 at 19:36
Are you looking for the tutorial from here - https://github.com/ngageoint/geopackage-js/tree/master/leaflet
// Load the Rivers GeoPackage and display the tile layer
L.geoPackageTileLayer({
geoPackageUrl: 'http://ngageoint.github.io/GeoPackage/examples/rivers.gpkg',
layerName: 'rivers_tiles'
}).addTo(map);
// Load the Rivers GeoPackage and display the feature layer
L.geoPackageFeatureLayer([], {
geoPackageUrl: 'http://ngageoint.github.io/GeoPackage/examples/rivers.gpkg',
layerName: 'rivers'
}).addTo(map);
-
Did this tutorial but not postgis and as I understand the request is not to getpackage and to wms. earder.com/tutorials/postgis_geoserver_leaflet Which path should I prescribe? – Upronin2111 Sep 16 '20 at 19:34
You can publish the GeoPackages through GeoServer as with any other datastore. Once you have done so Leaflet can request them as WMS layers in many different output formats including vector tiles. You may find it easier to start out with simple image layers and build up to more complex ones like vector tiles as you become more experienced.