New answers tagged

2

There are several reasons why your map does not work: If you specify origin when defining CRS, it is lower left corner of CRS, not center. In your case that would be [208311.05, 4614890.75]. When defining CRS, you don't have to specify bounds. If you do, they must be in the form of L.bounds object, the first two coordinates must be lower left corner and the ...


0

Since I struggled to find this answer, in your server block, you need something like this: observe({ click = input$map1_click if(is.null(click)) return() text<-paste("Latitude: ", click$lat, ", Longtitude: ", click$lng) text2<-paste("You've selected point ", text) map1_proxy = leafletProxy("...


0

You need to append to the contents of the input elements, not overwrite them, so your code becomes map.on("click", function(e) { var latlng = e.latlng; document.getElementById("lat1").value += latlng.lat; document.getElementById("lng1").value += latlng.lng; console.log(latlng); }); Note the += instead of = in lines 2 ...


2

Use the permanent option when creating a tooltip to keep the marker open. You can also use the direction:'bottom' option to position the tooltip below the marker. https://leafletjs.com/reference-1.7.1.html#tooltip-permanent .bindTooltip(`${planes[i][0]}`,{permanent:true, direction:'bottom'}).openTooltip()


1

I would recommend updating your leaflet version to 1.7.1 which is the latest, and note that there are differences between leaflet 0.7 and 1+. About your popup not opening the link, it's because you set the url as text, and not as a link. You should do this to create a link: marker = new L.marker([planes[i][1],planes[i][2]]) .bindPopup(`<a href=...


1

The bounds of your request almost certainly don't align with the grid (138.2187, -33.1375) doesn't look like an even division of a lat/lon grid which I would expect to fall on numbers of degrees for a large number of zoom levels. The simple solution is that if you want tiles then you should use a tiled map service like WMTS or TMS and take the guess work out ...


0

This is an old question but is the default question askers are referred to when asking about zooming on click. Adding a simple answer for any one wanting to zoom on clicked feature in layer. layer = L.geoJSON() # or whatever is the way you want to create your layer layer.on('click',function(e){ layer = e.propagatedFrom map.fitBounds(layer.getBounds()) }) ...


1

From what i can understand, your layer is not showing when you try to add it through the layer control. Your code was almost right, you just needed to add cluster to overlayMaps instead of geo. This code should work for you. var cluster = L.markerClusterGroup(); var geo = L.geoJSON(dataview, { onEachFeature: function (feature, layer) { layer.bindPopup(...


0

You need to remove the map click listener from your added node. This should make sure a map click is not recorded when you click the html node you added. resume.onAdd = function(map) { this._div = L.DomUtil.create('div', 'resume'); this._div.innerHTML = title + '<br>' + description; # This is your missing row########################### L.DomEvent....


0

I'm using react-leaflet with quite a few custom event handlers added to my leaflet map. I can't just stop propagation on the leaflet domevent because doing so caused issues (esp. with components from other frameworks I'm using such as material-ui). So in case anybody is in the same boat, here's a solution that's working for me! import React, { useEffect, ...


2

If you look in the documentation at https://github.com/SINTEF-9012/PruneCluster, you can read that cluster .ProcessView() method "Must be called when ANY changes are made.". In your case that means that you have to call it after removal of markers: ... pruneCluster.RemoveMarkers(markers); pruneCluster.ProcessView(); ...


0

For convenience, here is the URL format for GetFeatureInfo (version 1.1.1 ; remove end of lines, obviously) : https://geoserver/wms?SERVICE=WMS &VERSION=1.1.1 &REQUEST=GetFeatureInfo &QUERY_LAYERS=myLayer &LAYERS=myLayer &INFO_FORMAT=...


0

@Llaves's answer is correct, but if you also want the map to be completely full-screen in the same way that video can be full-screen, the easiest method is to add a Leaflet plugin which does that job for you. There are three possible such plugins listed on the official Leaflet plugins page: https://leafletjs.com/plugins.html#fullscreen-controls.


1

In the QGIS2Web dialog, click on the Appearance tab. A little more than halfway down click on the dropdown for Template, select Full Screen.


0

I think, this is not possible. Working with labels is difficult within qgis2web. You have two possibilities: Vector - Geometry tools - Centroids Save your layer. Set zoom/scale level for the layer, NOT for the labels (create labels). Size for points: 0px. Other placement for the labels: Move all points or move some points (...before 0px.....) Now you have ...


0

If you want to display markers with PruneCluster plugin, you cannot combine that with displaying the same markers through GeoJSON layer. If your markers are coming from GeoJSON data, you can use Leaflets L.geoJSON for iterating through features/points, but markers must be created only with instances of PruneCluster.Marker object. Since markers created with ...


2

The raster in question is not 8bit and has not been given a style, each requested tile is constrast stretched and reduced to 8 bits based on the data in the tile. Please configure a style for that raster that forces a fixed constrast stretch, or associates a colormap (guess you want the former, by looking at the image). See documentation here: https://docs....


2

Problem here is that Leaflet.markercluster plugin and Leaflet Control Search plugin do not know about each other, so there must be some tricks used to make them work together. First problem is that L.control.search call adds searched layers/markers to the map, which of course interferes with clustered markers. Solution to this is simply to remove layers with ...


2

You're confusing the Leaflet opacity option with a opacity WMS parameter. When instantiating a L.TileLayer.WMS, any options that are not known to Leaflet are treated as WMS parameters, as explained in the documentation: If any custom options not documented here are used, they will be sent to the WMS server as extra parameters in each request URL. This can ...


2

In your updateOpacity function you should use layer's setOpacity method: function updateOpacity(value) { wmsLayer_2.setOpacity(value); };


Top 50 recent answers are included