Hot answers tagged

24 votes
Accepted

Showing which way line features are oriented in QGIS?

Simplest way is to style the line. Add a new symbol layer to your line and change the 'Symbol Layer Type' to marker line. Select 'Marker' in the style tree and select a triangle as your default ...
user avatar
  • 4,276
20 votes
Accepted

Show/hide markers depending on zoom-level

All right. I came up with a solution using a layer: var shelter1 = L.marker([55.08, 11.62], {icon: shelterIcon}); var shelterMarkers = new L.FeatureGroup(); shelterMarkers.addLayer(shelter1); map....
user avatar
  • 621
18 votes

Using SVG icon as marker for a geoJSON point file in Leaflet?

I use this simple approach: var svg = ''; /* insert your own svg */ var iconUrl = 'data:image/svg+xml;base64,' + btoa(svg); var icon = L.icon( { iconUrl: iconUrl, } );
user avatar
  • 281
17 votes
Accepted

Using Leaflet Js, is it possible to know the onclick location of a Marker (ignore anchor point)?

On one hand: whenever Leaflet handles a mouse (or touch) event, you can access the original DOM event in the originalEvent property of the event. On the other hand: Given a mouse (or touch) DOM event,...
user avatar
  • 9,390
16 votes
Accepted

Unions of SVG Point Markers In QGIS?

Since your symbol are quiet simple, you can use a simple marker and set the blending mode to lighten
user avatar
  • 34.6k
15 votes

Leaflet Marker Mouseover Popup

You just have to add 'mouseover' and 'mouseout' event listeners to your newly created layer. You will also want to change the offset of the popup to make it higher. If not, you will have annoying ...
user avatar
  • 969
15 votes
Accepted

Changing colour of imported SVG icon in QGIS 3.4

You can simply do it directly in QGIS via Layer Properties > Draw Effects > Effect Properties. Open your SVG Layer Properties and click Draw Effects and then open the Star symbol Customize ...
user avatar
  • 24k
14 votes
Accepted

Custom marker and properties from geoJSON in Leaflet

To create a custom marker you can create a L.Icon object and for the popup you can use the onEachFeature option. Here is an example code snippet for these functions: var myIcon = L.icon({ iconUrl: ...
user avatar
  • 2,281
12 votes
Accepted

Adding arrow to Layout View in map of ArcGIS for Desktop?

You can add an Arrow in Arcmap. This is what you need to do: Using the Draw toolbar insert a straight line. Double click on the line and change its properties as illustrated in the below
user avatar
12 votes
Accepted

Rotate marker symbols individually in QGIS

Use Data defined override. Go to Layer Properties and in Simple marker style open the Data defined override menu with icon next to the Angle value. Choose Field Type -> "your column". Data defined ...
user avatar
  • 6,457
11 votes
Accepted

Zigzag Line Symbol in QGIS

It seems like there's no way to just symbolise the line as a zigzag: unfortunately, you'll have to alter the underlying data. You can get a reasonably good zigzag line by first splitting the original ...
user avatar
  • 6,661
11 votes

Using Leaflet Js, is it possible to know the onclick location of a Marker (ignore anchor point)?

You always can retrieve the coordinates from the Leaflet object map. You can use something like this: map.on('click', function(e){ var coord = e.latlng; var lat = coord.lat; var lng = coord.lng;...
user avatar
  • 4,326
10 votes
Accepted

Zoom to polygon bounds on click. Leaflet ´, GeoJSON

Probably: markers.on("click", function (event) { // Assuming the clicked feature is a shape, not a point marker. map.fitBounds(event.layer.getBounds()); }); You may want to detect if the ...
user avatar
  • 6,853
9 votes

How to change Leaflet marker color on mouseover?

Figured it out thanks to some documentation reading. The polygon in leaflet responds to setStyle but the marker can be changed using setIcon Documentation for setIcon
user avatar
9 votes
Accepted

Changing size of cluster based on number of markers in Leaflet clustermarker

Starting from the custom example from the github repo, modify the iconCreateFunction to add a different css class based on the size of the cluster: iconCreateFunction: function (cluster) { var ...
user avatar
9 votes
Accepted

Adding popup to Leaflet but only on click?

Just leave out call of .openPopup() method: mymarker.bindPopup('<p>You are here ' + username + '</p>');
user avatar
  • 17k
8 votes

Enabling all layers by default using Leaflet?

For the sake of completion, as per https://github.com/Leaflet/Leaflet/issues/3199#event-230611315: Simply add the layer directly to the map. map.addLayer(layer) The control layer function will pick ...
user avatar
  • 987
8 votes
Accepted

How can I prevent Leaflet from moving my marker while zooming into the map?

See Leaflet doc about iconAnchor option: The coordinates of the "tip" of the icon (relative to its top left corner). The icon will be aligned so that this point is at the marker's geographical ...
user avatar
  • 6,853
8 votes
Accepted

Leaflet routing control change marker icon

The issue is that the createMarker function is called for every waypoint, so obviously the resulting markers will look the same. To work around it, you simply use the arguments that you already have. ...
user avatar
  • 1,709
8 votes
Accepted

"Orphan Symbol" problem with QGIS marker line symbol

The issue arises because the symbol is asked to be located 8 mm away from its supposed location. To overcome this, you will want not to offset the symbol but rather the marker location along - but on ...
user avatar
  • 34.6k
8 votes

Changing colour of imported SVG icon in QGIS 3.4

You need to edit the SVG file and replace the fill="#000000" stroke="none" by something like fill="param(fill) #FFF" stroke="param(outline) #000" stroke-width="param(outline-width) 1" the "...
user avatar
  • 12k
7 votes
Accepted

Show markers only at certain zoom levels

I think there is no better way than to handle zoomend event. To group markers by zoom levels, use L.LayerGroup: turning them on and off will be easier. Calling map.removeLayer() or map.addLayer() ...
user avatar
  • 2,238
7 votes
Accepted

How to change Leaflet marker color on mouseover?

Seems like you can't do that because a marker uses an image to render. I think you'd need to grab the icon class of your marker and change the "iconUrl" attribute to whatever new image you want. ...
user avatar
7 votes
Accepted

Leaflet marker/icon help

It looks strange that you add both a GeoJSON layer from result.geojson and a marker created from [result.lat, result.lon]. If result.geojson contains the same point information as [result.lat, result....
user avatar
  • 6,853
7 votes
Accepted

SVG markers made in InkScape appear transparent in QGIS

I see the same issue. Took a look at this file in InkScape, and used Shift-Ctrl-F to bring up the Fill and Stroke properties. I noticed that the fill on your green and blue areas were set to 'pattern ...
user avatar
  • 19.8k
6 votes

Multiple font markers in shapefiles in QGIS?

You can add another symbol layer: Select the new symbol layer, add your letter/symbol and alter the Offset X,Y, so in your case it would just be the X.
user avatar
  • 72.4k
6 votes
Accepted

Change marker color based on GeoJSON filter in Leaftlet

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, ...
user avatar
  • 6,738
6 votes
Accepted

How to get attribute of the leaflet marker?

If you still have the reference to your marker, simply use marker.options to access the options object assigned to it. In your case: marker.options.draggable.
user avatar
  • 6,853
6 votes
Accepted

Custom marker based on geojson attribute in Leaflet

First, your GeoJSON is invalid. Each feature should have a geometry and a properties property. i.e. the following is wrong: var feature = { "type":"Feature", "geometry":{ "type":"Point", "...
user avatar
  • 9,390
6 votes
Accepted

Multi Symbol for Pointlayer in PyQGIS

If I understand your question right - You solved the Problem by creating Symbol in QGis, but you don't know how to write it in pyqgis, right?! Try this: symbol = QgsMarkerSymbolV2.createSimple( ...
user avatar
  • 876

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