Answer the question
In order to leave comments, you need to log in
OSM map on site locally?
There is a base containing OSM map tiles.
How, using Leaflet, to connect these tiles locally?
I saw a way with a virtual server, but not with a database. What are the ways to connect the map to the site locally?
Answer the question
In order to leave comments, you need to log in
Depends on the required detail. I made a local map on GeoJSON tiles (tiles - portioned loading of the map, GeoJSON - to vectorize). Rendering goes completely on the client side, if you add gzip data compression on the server, then the tiles generally weigh little. The server works with the postgresql database - coordinates with the polygon data type - due to this, the logic of the intersection of polygons is available - in the request we specify the polygon (bounding box) of the tile, which is easily calculated by its x,y,z coordinates. The database contains several tables grouped by type - roads, railways, houses, forests, rivers, lakes. The speed of returning tiles depends only on the performance of the database engine. The return of types to increase can be adjusted on the server side.
I used OpenLayers for display - you need to write and think more (but rendering is completely customizable), otherwise Leaflet is too simple. In principle, he should also be able to work with GeoJSON tiles.
Locally, it is only necessary if the card is part of the software in a closed corporate network where the Internet is limited - because in any case you will not store the card in the detail in which it is presented on the Internet.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question