I am trying to learn how to develop a Django application using its geoDjango spatial extension. I am using PostgreSQL/PostGIS, GeoServer and Leaflet. I want to display multiple WFS polygon layers from GeoServer on the map using Leaflet? What is the right way to do this?
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by OpenStreet Map'
initializing a map container only if it is not already initialized
I have a very specific "Map container is already initialized" problem different from other such questions I've found in my prior search. My web page has a lot of images. If the images have a location associated with them, they are rendered as a simple carousel. Clicking on the carousel renders and reveals their specifc map location. In other words, there are several maps on the web page.
Leaflet show different icons
I'm creating a map with leaflet using marker cluster and I want to show a different icon for each place. Here is the beginning of my code.
River network WMS layer not showing in Leaflet map
I am trying to display a map of European river network on a Leaflet map, using as data source the EUHydro layer published by CLMS (here is the webpage, and the WMS GetCapabilities document).
Binding id to each layer in Leaflet?
bindPopup gives the correct id, how do I get the correct id from the click event? The code below gives the id of the last layer.
Leaflet Easybutton to load zipped shapefiles - and Geojson, kml, gpx.. not giving properties except for shapefile
The following code allows for loading local shapefiles, geojson, kml and gpx, but items properties are not the same. only shapefiles will return its properties with a bindpopup of global properties.
Setting custom svg icon for external geojson point layer
I have returned to Leaflet, I have exported layers from QGIS as geojson and edited the file and added a var. Everything is fine with the polygons, however, for my point layer I would like customise the icon to be a svg image.
How to set bounds to combination of two point features in leaflet
Asked today Viewed 3 times I am creating an app with django, geodjango and Leaflet, I am also using django-geojson and django-leaflet. I manage to insert on a map two features that contain points. But i am getting problems setting the bounds for that map. Since I am adding two sets of points to the map i would like to set the bounds to the combination of both sets.
Getting all layers hovered over in a layer stack in Leaflet?
Unlike OpenLayers, which has map.getFeaturesAtPixel and map.forEachFeatureAtPixel methods, Leaflet has no such methods. The only way in Leaflet to get layer at current mouse position is to declare event processing function layer.on('mousemove', evtProcessingFunction). Problem with this function is that in the case of overlapping layers it detects only the layer at the top.
Dynamically change layers on feature click in Leaflet
I need to dynamically change layers on a leaflet map on click, having two GeoJSON files, one for states and other for cities, like a dashboard. When clicking a state it should zoom to the clicked state, remove states layer and show only the cities that are within that state, which could be done filtering by a attribute (CITY_NAME in case) in cities geojson that refers to the state it belongs.
Leaflet dinamically change layers on click
Asked today Viewed 2 times I need to dinamically change layers on a leaflet map on click, having 2 geojson files, one for states and other for cities. When clicking a state it should zoom to the clicked state, remove states layer and show only the cities that are within that state, which could be done filtering by a attribute (NAME_1 in case) in cities geojson that refers to the state it belongs.
Interactive Choropleth Map by external javascript
Asked today Viewed 3 times how can i apply the same mathod as presented in https://leafletjs.com/examples/choropleth/ on my dataset which provided as JavaScript in my hard not by online access so i generated a .js whith such content: let jsonProvince={ "type": "FeatureCollection", "name": "TR_Provinces_Demographics GeoJSON", "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:EPSG::4230" } }, "features": [ { "type": "Feature", "properties": { "ILLER": "ADIYAMAN", "Nüfus":...
Offset of markers and polygon depending on zoom level in Leaflet
I have run into a problem with a suspicious offset what comes to self created polygon using Leaflet. I am creating a website using NodeJS (and Pug for rendering the HTML itself). Using Leaflet, I would like to get a polygon drawn on the background map. I am adding the polygon using the old good var polygon = L.polygon([all coordinates], {color: 'red'}).addTo(map). However, the polygon's placement is not accurate.
ios - expoding map dic on faucet on ipad
I am developping a leaflet app for cell units. It appeared to be working OK until immediately. On an Ipad the map stays within the div I set for it, untill i faucet on the map or a marker. Then the map fills the entire display screen and hyperlinks turn into inoperable. I managed to position a button over the map, however on tapping the map makes it dissappear off the display screen. Not below the map however dissappeared.
Wikipedia layer in Leaflet
Asked today Viewed 14 times I have been trying to move examples of Wikipedia layers to my file server. They work when opened via file explorer, but not when uploaded. All that I have changed are the addresses for the JS files. I can generate the maps, but either don't get no Wikipedia icons, or the bindPopup functions stop working.
Use data from JSON file with Leaflet GeoJSON marker
Asked today Viewed 3 times I have a JSON file that I am fetching from and I would like to use the 'LAT' and 'LON' attribute to place markers. The problem is I am unable to see any markers appear. I think it's because the file is not formatted as a GeoJSON file. I've tried to implement it in my getBuildings function.
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with OpenStreet
Contact OpenStreet, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack