Questions tagged [openlayers-7]

v7 specific questions on the OpenLayers mapping library

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

42 questions
3
votes
1 answer

ol/controls/default not a function in OpenLayers 7.1

With OpenLayers 6.15.1, I can use the following code in my map options: controls: ol.control.defaults({ zoom: true, attribution: true, rotate: false }), With OpenLayers 7.1, this does not work anymore. I get an error: Uncaught…
Thierry
  • 31
  • 3
2
votes
1 answer

OpenLayers 7 - Check if coordinate is within layer extent

I'm struggling to get OpenLayers to check whether a coord is within a layer's extent. It took me a while to get it to even check something, but it only ever returns false, even when passing it the center of the extent so I'm clearly doing something…
mr_magpie
  • 23
  • 2
2
votes
1 answer

TypeScript + OpenLayers 7: Set and get feature id fails

I have a map with two custom buttons: Draw Polygon and Remove Feature, which allows me to draw- and remove drawn polygons. In addition, I create a measure overlay for the polygon(s) which show their area (see image). To identify the connection…
robtot
  • 863
  • 1
  • 9
  • 31
1
vote
0 answers

How to make a delay for Feature movement using Translate in OpenLayers 7?

The problem is that I need to make it so that the point can only be moved after 400ms of holding the point I add Translate for a point when adding the point itself Now the point can be moved at any time, the delay in onPointTranslateStart listener…
1
vote
0 answers

Split a multipolygon and polygon by drawing line programmatically from a point selected by the user on that polygon or multipolygon

I have a map which consists of multipolygons and polygons. Firstly the user selects a polygon or multipolygon from the map by clicking on it then user selects a point on that multipolygon and then the line(split line) drawing should be started from…
1
vote
1 answer

How to tell if a point is visible on current OpenLayers map

Hi I'm trying to figure out if a given point is currently visible on my map. I'm using open layers 7 and have a simple map with a marker on it. User can move both the map and the marker independently. Every time the either the map or the marker are…
user3182413
  • 59
  • 1
  • 7
1
vote
1 answer

Openlayers: Update clusters depending on filter (geometryFunction)

I have a geojson and use openlayers to show features on a map. I cluster them. Now I want to add a filter to the UI, allowing users to filter the map depending on some feature properties. const vectorSource = new VectorSource({ format:…
Merc
  • 4,241
  • 8
  • 52
  • 81
1
vote
1 answer

TypeScript + OpenLayers 7: Can't find features on custom layer with forEachFeatureAtPixel() method

I can't find features on a custom layer with the forEachFeatureAtPixel() using the coordinates from a map.on('click') event listener. The process is simple: I create the map object I add a custom layer (FeatureLayer) to the map I draw polygons…
robtot
  • 863
  • 1
  • 9
  • 31
0
votes
1 answer

How to trigger select event in openlayers map in angular for unit test?

How can I trigger a select interaction on openlayer map in angular unit testing? below is my select event code. let select = new Select({style: null}); select.set('selectInteraction', 'name'); select.on('select', (e) => { …
Prabhakaran
  • 1,264
  • 2
  • 20
  • 47
0
votes
0 answers

how to get extra data from openLayers feature

I have some GeoJSON files for my APP, I used these files as my Vector Layers source , I put some extra data in files like name, Enabled and..., I use to reading this file each time I need some more info but the thing is I want to achieve this info…
0
votes
0 answers

Unable to get the Correct URL from the getFeatureInfoUrl method in OpenLayers 7 using Angular

I want to get the Information of the Layer and display it to the user. Here I used getFeatureInfoUrl method of OpenLayers 7 to get the URL but I am getting the BBOX,I and J values as NaN I have to get the URL like this :…
0
votes
0 answers

map.foreachfeatureatpixel() not working in angular typescript open layers 7

The code working in normal JavaScript finely but in Typescript (Angular) it was throwing an error that this.map.forEachFeatureAtPixel(), this.map is undefined and cannot read properties of undefined. This is my code : public selected:…
0
votes
0 answers

OpenLayers 6/7: Toggle feature visibility

How can I toggle the visibility of a feature in OpenLayers? There are similar posts, which answers suggests to change the feature style. However, I have a scenario where the style is unknown, so I can't assign it back when I want to show the feature…
robtot
  • 863
  • 1
  • 9
  • 31
0
votes
0 answers

Adding a tiff layer into a map throws GeoTIFF is not defined in 7.4.0 and this.blockIdsToFetch.has is not a function on 6.15.1

I am trying to add a tiff layer to my map and im basically trying to do this example, on my map, but it keeps throwing errors. I recreated the code in jsFiddle open the browser console and you will see it. is this a problem with ol ? or am i doing…
khaled
  • 33
  • 1
  • 1
  • 7
0
votes
1 answer

Trouble with html2canvas and copying a map using OpenLayers7

I'm trying create a webpage using open layers 7 that allows users to load a map then zoom, rotate or change the tilelayer being used as the bg. Once day they can hit a button which should copy their map to an html canvas. I am trying to use…
1
2 3