Tag Info

Hot answers tagged

3

To create Voronoi polygons in QGIS there's a tutorial here use Vector::Geometry Tools::Voronoi Polygons. This produces one polygon per input point; the attributes are copied to the polygons which is important later. Dissolve the Voronoi polygons using the territory attribute from the points to form territories. Vector::Geoprocessing Tools::Dissolve .


3

Just change var smallIcon = L.Icon({ options: { iconSize: [27, 27], iconAnchor: [13, 27], popupAnchor: [1, -24], iconUrl: 'icone/chapel-2.png' } }); to var smallIcon = new L.Icon({ iconSize: [27, 27], iconAnchor: [13, 27], popupAnchor: [1, -24], iconUrl: 'icone/chapel-2.png' }); See the icon official ...


2

Read the documentation of Leaflet-omnivore here: https://github.com/mapbox/leaflet-omnivore You can pass a custom layer as a third parameter of omnivore.topojson(). By default, it is simply L.geoJson(). In your case, you should use something like this: var customLayer = L.geoJson(null, {style: style}); omnivore.topojson('./data/bmw_parcels_4326.json', null, ...


2

The problem is not in the code, but on the image itself. The Geotiff has 3 bands, and the nodata value is set to 0 Band 1 Block=508x8 Type=Byte, ColorInterp=Red NoData Value=0Band 2 Block=508x8 Type=Byte, ColorInterp=Green NoData Value=0 Band 3 Block=508x8 Type=Byte, ColorInterp=Blue NoData Value=0 However inspecting the image in QGIS, it ...


2

(I edited my answer for your follow-up questions) You have to use the order in which the node IDs are referenced by the corresponding <way> element in the XML file. In contrast, the order in which the <nodes> elements appear in the XML file is completely irrelevant. Furthermore, as you already discovered, a relation can contain multiple ...


1

Did you try this? var layers = []; map.eachLayer(function(layer) { if( layer instanceof L.TileLayer ) layers.push(layer); }); For complex cases you would end up writing your own layer switcher, and I don't see anything wrong with that. The Leaflet library aims to provide a minimum of core functions for an interactive map. If you need a bigger, ...


1

the layer is available from the event; in your case e.layer returns the layer alternatively, you save the layer to a variable when you construct it with L.geoJson, then bind your click event later: var streets = L.geoJson(data.streets, { onEachFeature: function(feature, featureLayer) { featureLayer.bindPopup(feature.properties.name); }) )} ...


1

You were on the right way with onEachFeature. It's just you have to bind event click on each element. See below (tested) function whenClicked(e) { // e = event console.log(e); // You can make your ajax call declaration here //$.ajax(... } function onEachFeature(feature, layer) { //bind click layer.on({ click: whenClicked }); ...


1

You may need to look at the second step. The tutorial started you out with just creating the tiles. Then tutorial added support for the "hit grid" created by the "Teaser" tab in TileMill. The teaser step created another part of the .mbtile spec. The mbutil utility is used to extract either the grid or tiles. In the second run, it extracts both. In the ...


1

No, it doesn't have a fixed release date, but will be released "when done". The plan was "in October", but has already shifted. You can track this and this milestones for 1.0-beta version, but the number of issues there is too high to be optimistic about this year release of 1.0-final.


1

Didn't have time to take a look before but following Leaflet documentation http://leafletjs.com/reference.html#geojson, you just have to change GeoJSON layer declaration from: gJson_layer_1 = L.geoJson(gjson_1, {style: style_1}).addTo(map) to : gJson_layer_1 = L.geoJson(gjson_1, { style: style_1, onEachFeature: function (feature, layer) { ...


1

here is a rough, general approach, with a few code examples (using jQuery/javascript): Set up a couple of color styles for the markers (using circle markers here) var blueMarker = { radius: 8, fillColor: "#0000ff" }; var redMarker = { radius: 8, fillColor: "#ff0000" } Add the geojson features as L.circleMarkers, keeping track of each as a ...


1

the two links ThomasG77 posted is great. Especially Fusesearch, but I could not get to work, I installed Fuse but still could not get it running. So I settled for Leaflet Search. The examples given is not that informative so here is a nice example that I found that works great. Hope this helps. In the example replace LayerNameJSON with your geojson layer ...


1

There are various solutions for this (if you don't want exact zoom but centering). You can use using the list from Leaflet plugins page: Leaflet search Fusesearch You can also take a look on the Bootleaf project, a Bootstrap based Leaflet template using typehead.js (an autocomplete search box). All the mentioned projects above have demos available so ...


1

Here is a post I have written regarding how to achieve this, I have covered many things including web-sockets here. http://yasassriratnayake.blogspot.com/2014/09/developping-web-bases-realtime-updating.html


1

Late response, but here is a talk demoing how to use vert-x, Leaflet and websockets for a real-time bus position tracker http://vimeo.com/106234599



Only top voted, non community-wiki answers of a minimum length are eligible