Leaflet / Leaflet/Leaflet.VectorGrid

I cant display points. I can't change the style points/polygons.

Open
#255 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
676
Forks
202
PR merge metrics
No merged PRs in 30d

Description

I have only polygons and points in my database. It is in one table and one column. I do not store any more signs (river, house, etc. ... this is not).
Polygons are displayed normally. I just need to display the points, with my own style. It's strange why the points are not shown.
Also, I cannot change the style for all polygons.
I looked at the help. Perhaps I need something much simpler ...
Thank you in advance!

<script type="text/javascript"  src="https://unpkg.com/leaflet.vectorgrid@1.2.0"></script>

<script>
var vectorTileStyling = {}
var openmaptilesUrl = "http://192.168.0.57:8080/{z}/{x}/{y}.pbf";
var openMapTilesLayer = L.vectorGrid.protobuf(openmaptilesUrl, {
	vectorTileLayerStyles: vectorTileStyling,
	attribution: '© OpenStreetMap contributors, © MapTiler'
});
...
var overlays = {
	"Vector Tiles": openMapTilesLayer
};
...
L.control.layers(baseLayers, overlays).addTo(mymap);
</script>

SQL on server:

WITH webmercator(envelope) AS (
  SELECT ST_TileEnvelope(15, 20891, 9773)
)
SELECT ST_AsMVT(tile) FROM (
	SELECT osm_id , tile1 FROM (
	  SELECT osm_id, ST_AsMVTGeom(poly3857, (SELECT envelope FROM webmercator)) as tile1
	  FROM polygon43
	) a
	where tile1 is not null)
AS tile

DBeaver
DBeaver2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Leaflet.VectorGrid setup, especially the empty vectorTileStyling object and the vectorTileLayerStyles option, then inspect the supplied ST_AsMVT query for how point and polygon geometries are returned. Reproduce the map with the provided tile URL and SQL, and consider the issue complete when points render with a custom style and all polygons can be styled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, sql
Domain
database, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.