3 votes

OpenLayers GeometryCollection styling issue

Problem is that you are referencing global value labelInput.value when defining text label in the style. This causes style to always reflect current value of labelInput.value when styling features. ...
user avatar
  • 16.7k
2 votes
Accepted

How to get layers name added to OpenLayers map v6.14.1?

Layers in OL do not have names by default, but you can give layer a name by setting some custom layer property, like for example using custom option name: 'My layer name'. Then your code above will ...
user avatar
  • 16.7k
2 votes

How to snap a graphic to a vector basemap layer

It is not possible to snap to Vector Tile Layers right now. The types of layers you can snap to are defined in the type of the layer property of FeatureSnappingLayerSource: FeatureLayer GraphicsLayer ...
user avatar
  • 21
1 vote
Accepted

How to add image in Mapbox with turf.js grid

This is not really a GIS question but more of a general HTML/JS nature, but anyway, here's how you can solve this. You can read each image that has to be repeated only once, draw it on the canvas and ...
user avatar
  • 16.7k
1 vote

Detecting Leaflet layer type (react-Leaflet)?

Since I'm not familiar with React, answer will be for vanilla Leaflet JS. Since Leaflet layers have no property that can be used to detect layer type, one possible solution is, when creating layer, to ...
user avatar
  • 16.7k
1 vote

Change popup content with JavaScript

Define your show_hide() function on global level and then call it with text parameter you want to replace current text with. Code could then look something like this: function show_hide(element, txt) ...
user avatar
  • 16.7k

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