Questions tagged [openlayers-6]

v6 specific questions on the OpenLayers mapping library

OpenLayers v6 is the latest release of the OpenLayers mapping library.

412 questions
1
vote
1 answer

OpenLayers - Heatmap | Override default overlap weight calculation

I am trying to implement an OpenLayers Heatmap to visualize some data on a map. My goal is to display heatmap points with given weights. Currently my poc code looks like this: const features = [ { lat: 46.934942, lon: 17.891804, id: 10, value: 6.5…
Csanád
  • 13
  • 2
1
vote
1 answer

OpenLayers 6 DragZoom Control - how to change condition

in OL 6 I would like to use a button, so a user can click to activate a change for the drag zoom control so it will be available without holding down shift. In https://openlayers.org/en/latest/apidoc/module-ol_interaction_DragZoom-DragZoom.html it…
1
vote
1 answer

OpenLayers Inconsistent Hit Detection on MVT Layer Hover Selection

The objective I'm trying to replicate the "singleselect-hover" feature in this example from the OpenLayers site. The issue When I tried to use this implementation, the hit detection was very poor with vtLayer.getFeatures(event.pixel). The…
1
vote
1 answer

Not able to toggle Fullscreen button in openLayers

I am implementing fullscreen feature. I need to toggle fullscreen button in below 2 scenarios When fullscreen mode is false, I need to dispaly "fullscreen(as per code)" button on map. Which is working properly. When fullscreen mode is true, I need…
Sneha
  • 81
  • 1
  • 5
1
vote
1 answer

adding custom angular component as control in OpenLayer map

I want to add my own component as a zoom control for an openlayer map. from here I see that I can do that easily if I create some html elements. But I already have this zoom component that I use elsewhere and I was hoping to reuse it, but I have not…
solar apricot
  • 353
  • 2
  • 5
  • 24
1
vote
0 answers

Openlayers infinite loop called when clear()

I created the function that enable selection of feature from map, with 2 functions thats are called when I click on feature or when I click on map (no feature selected) E.G select = new ol.interaction.Select({ toggleCondition:…
Jérome BORGA
  • 555
  • 1
  • 3
  • 12
1
vote
2 answers

How to add properties to a rendered feature of TileVectorLayer

as shown in the below posted code, i create a VectorTileLayer and the VectorTileSource is MVT geometry that is retrieved from a webservice as stated in the url attribute. the database table contains the columns as shown below. For each zoom-in and…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
1
vote
2 answers

In OpenLayers 6.9.0 I use fetch WMTSCapabilities but I it doesn't work

I use fetch WMTSCapabilities but I get this message: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'Layer') at Function.rL.source.WMTS.optionsFromCapabilities (ol.js:2) This is the code I use: const parser = new…
1
vote
1 answer

svelte two components to access same object

In my app, I have a route map.svelte This has two child components: Map.svelte and LayerSelector.svelte Map.svelte creates an OpenLayers map instance. LayerSelector.svelte needs to access this instance. I am declaring the map instance in map.svelte…
minisaurus
  • 1,099
  • 4
  • 17
  • 30
1
vote
0 answers

Polygon boundary not removed after clear source: OPENLAYERS

I want to delete a polygon on a layer. It works on my localhost, but not on the production server. In production, after calling removeParcel the source gets clear and the feature on this source also been removed. But the polygon boundary is still…
Abdul Malik
  • 541
  • 4
  • 16
1
vote
1 answer

OpenLayers 6 : Map render doesn't happen on zoom

I've been looking everywhere for days about my issue, but still can't find a good solution to this problem. I had to do a project using openlayers, to create maps that are included in iframes on different cities websites, to show some informations…
pvoc
  • 21
  • 4
1
vote
1 answer

unwanted artifacts in COG GeoTIFF

The new GeoTIFF support in OL 6.7 is a very impressive. I'm getting artifacts in near-white areas in OL that are not in EOX COG-Explorer which uses the same geotiff.js lib.The first image below is from EOX COG-Explorer, the second is from OL 6.7.…
Richard Greenwood
  • 876
  • 1
  • 10
  • 20
1
vote
0 answers

How to undo or delete point interaction in openlayers

Let's say that we added a point into to the map by using the code below: const addInteraction = (source) => { draw = new ol.interaction.Draw({ source: source, type: "Point", style: new ol.style.Style({ fill: fillStyle, …
Jantoma21
  • 395
  • 4
  • 10
1
vote
0 answers

Changing the max extent of a view after initialization in OpenLayers

I want to be able to dynamically change the maximum extents of my OpenLayers map after initialization. The use case is, users can change their base map, and some of these base maps cover the whole world, some only part of it, so if they switch to a…
Rob Quincey
  • 2,834
  • 2
  • 38
  • 54
1
vote
1 answer

How do I fix Typescript errors in OpenLayers 6.6.1

After upgrading to OpenLayers 6.6.1 I am receiving hundreds of typescript errors caused by generics. For instance... import olLayerVector from 'ol/layer/Vector'; import olFeature from 'ol/Feature'; public static highlightOverlay: olLayerVector =…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57