Hot answers tagged

5

Using QGIS 3.10, you may click on the small wrench-icon in the icon-panel at the top of the identify-tool window (see screenshot). Make sure the (only) option is deactivated. The documentation for 3.4 suggests, there is a checkbox somewhere, you can uncheck. I suggest you upgrade your QGIS and then use the method described above.


4

In your bindPopup, make sure the call to the GeoJSON property matches its actual name: var markerStyle = { radius: 3, fillColor: "#E4007C", color: "#E2062C", weight: 1, opacity: 0.9, fillOpacity: 0.7 }; var city = L.geoJson(cities, { pointToLayer: function (features, latlng) { return L.circleMarker(...


3

When you create marker cluster group from GeoJSON data that contains only points for markers, and you markers will be L.circleMarker markers, you must have the following in mind: You can use L.geoJSON for parsing GeoJSON data, creating desired markers and adding them to cluster, but you don't add GeoJSON layer to the map. Markers of type L.circleMarker are ...


2

You can do that accessing the QgsMapToolIdentify.identifyMenu() and adding a custom action to it. To test it, just run once the following code snippet in the QGIS Python Console. Then activate the identify map tool and... voilà ! b_action_added = False # To avoid duplicating the action def action_slot(layer, feature): """What our new ...


2

I submitted this as an idea and apparently it can be done in ArcPy for ArcGIS Pro using the Cartographic Information Model: https://community.esri.com/t5/python-ideas/ability-to-access-the-popup-object-in-arcpy-arcgis-pro/idc-p/1042108#M32 The code snippet provided was as follows: p = arcpy.mp.ArcGISProject('current') m = p.listMaps('Map')[0] l = m....


2

You were pretty dang close. When we want to extend or alter prototypes in leaflet, we use the .extend and .include functions on the prototype class itself. So you'd want to do this: L.Layer.include({ setInteractive: function (interactive) { if (this.getLayers) { this.getLayers().forEach(layer => { layer.setInteractive(...


2

dojo.connect(map,"onClick",function(evt){ var query = new esri.tasks.Query(); query.geometry = pointToExtent(map,evt.mapPoint,10); function pointToExtent(map, point, toleranceInPixel) { var pixelWidth = map.extent.getWidth() / map.width; var toleraceInMapCoords = toleranceInPixel * pixelWidth; return new esri.geometry....


2

As suggested, you can add a simple css rule to determine max width for the images. The answer here won't work for you anymore since leaflet has changed the name of the popup content class. There is also the problem where qgis2web uses a table inside its popups. what you need to do, is open the index.html file and edit the ` tag. instead of just: <style>...


2

QGIS freezes as it is processing because you need to set 'setWindowModality' for QProgressDialog object and a sleep (delay) time for each task. Another issue is referred to 'setRange' method. It was already set in QProgressDialog object (as parameters ..., 0, 100). So, for three processing tasks following code works as expected: import time m = "" ...


2

If you want to have popup for each layer, you have bind it to each individual layer, not to the cluster: var my_data = new L.GeoJSON.AJAX("http://127.0.0.1:8000/my_data/",{ onEachFeature: function(feature, layer){ layer.bindPopup(feature.properties.siteid); } });


2

Leaflet (by default) takes the fillColor option given to any instances of L.Path and turns that into a fill attribute of a SVG <path>, as per this fragment of code: if (options.fill) { path.setAttribute('fill', options.fillColor || options.color); path.setAttribute('fill-opacity', options.fillOpacity); path.setAttribute('...


2

For a project I managed to create something like you asked on ArcGIS Online a while ago. In order to display your desired pop-up, you should combine both url + link text information in one column as an html code. ArcGIS Online will display it automatically as link text + url. For example, the html code used to get the pop up on the image was like this: <a ...


2

In Leaflet each member of a group layer (marker is member of GeoJSON group layer) gets internal id, which can be retrieved with .getLayerId method. This id can later be used to retrieve desired member (marker) with the .getLayer method. When you construct your popup with attachPopup(layer), you can retrieve marker layer id with var layerId = markers....


1

You're in Map Viewer Classic, correct? It appears you construct your pop-up to the Map Notes layer when you first add it to the map. For example, Have you ever tried the new Map Viewer? You might be interested in the enhanced popups it has.


1

As per the Arcade documentation for IsEmpty: IsEmpty( value ) -> Boolean Returns true if the provided value is null or an empty string (e.g. ''). Returns false for all other cases, including empty arrays and dictionaries. https://developers.arcgis.com/arcade/function-reference/logical_functions/#isempty Check for a zero sized array instead IIf(count(...


1

This should work on any browser var properties = features[0].getProperties(); var subset = { Address: properties.Address, Postcode: properties.Postcode, X_Coordina: properties.X_Coordina, Y_Coordina: properties.Y_Coordina }; info.innerText = JSON.stringify(subset, null, 2);


1

As @IvanSanchez wrote in his comment, the reason for the error is that you are using function call instead of function object when defining click event handler. It should be click: popup, not popup(feature, layer). But even in that case it would not be correct, since popup handler would bind layer popup again and again at each click. Correct way is to bind ...


1

I've had very little experience in embedding controls into pop ups nor am I a fully fledge web developer but I can tell by looking at your sample code that its incorrectly structured. First of all look at this blog there is a code snippet in it. You have your code structured as such: <audio controls=""> <source src="https://...


1

The key step is to either have a field with the filename, or create an attribute expression that has the file name (or full URL), but not the full HTML. If you have a field with contents that matches the file name, it's as easy as configure the pop-up, choose "A custom attribute display", and click the icon for "View HTML Source" and add: ...


1

You didn't mention you are using Leaflet.markercluster plugin , which is not part of standard Leaflet distribution. If you look at the docs of .zoomToShowLayer(layer, callback) plugin method, you'll read: Zooms to show the given marker (spiderfying if required), calls the callback when the marker is visible on the map. There is no mention of popup being ...


1

You can track the following event. While double click it's always: click click double click Exactly in this order. So: let dbl = false; map.on("click", "boundary", function(e) { dbl = false; setTimeout(() => { if (!dbl) { new mapboxgl.Popup() .setLngLat(e.lngLat) .setHTML("popup ...


1

Problem is in the way you are handling radio button selection. On each selection you define new map click event function with map.on('click', ..., but the previous ones stay valid. As a consequence upon each click all those functions get fired. Solution is to define map click event processing function only once and then within it decide which layer will be ...


1

You can simply use something like: var popupContent = '<p>' + feature.properties.Name + '<br>' + feature.properties.PopupInfo + '<br>' popupContent += feature.properties.image_link ? '<img src="' + feature.properties.image_link +'" style="width:200px;height:125px;"> </p>' : ' </p>' var popup = new ...


1

The fix for this was simple; although it still moves the view down whenever the popup closes. But it creates a scroll on the right, allowing the user to scroll up and makes the navbar visible again. Basically, the change I made was to add fixed-top to the class. <nav class="navbar navbar-inverse navbar-dark bg-dark fixed-top" style="margin-...


1

I don't think this can be achieved with dialog boxes. However, there is something better: the MessageBar. Have a look at: Is it possible to show our custom message in QGIS Status bar using python?


1

The arcgis js api has the hitTest function in views, you can use that to get all the layers under the mouse click and create a new popup with all the data you want to show. Using something like this should work for simple objectid showing of every layer: var hitResults; var popupContent ='' view.on("click", function(event) { hitResults=[] ...


1

You can use a third field to show the link. Creating a new field with an expression like this: '<a href='+ "PIN_SOA" +'>'+ to_string("PIN") +'</a>' The link will remain the same link, you just style it in a way that is comfortable to you. To prevent some fields to be shown in the popup I would copy my layer to a virtual layer ...


1

You actually almost got it. The problem in your code is that you are using template2 in the feature layer flayer. In order to get the result you want, use template for flayer, const fLayer = new FeatureLayer({ portalItem: { id: "b5665da3feab4b6091914cbfe4ab028f" }, popupTemplate: template, // <- template for popup layerId: 0, ...


1

You just need to assign a popup template to any sublayer you want to present information on their features. Take a look at this example I made for you, <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <title>ArcGIS API for ...


1

As confirmed by ArcGIS Dev on Forum, as of 4.16 Cluster do not support to getChildGraphics of cluster and also do not support different renderer for cluster.


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