Questions tagged [openlayers-5]

v5 specific questions on the OpenLayers mapping library

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

From https://openlayers.org/:

OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).

v5 reworked the library as a set of ES Modules, and improved compatibility with mainstream module bundlers.

317 questions
0
votes
2 answers

Scaling the icon-image size to an absolute value

I'm developing an application where one functionality is displaying a device on a map using open-layers. These devices can be added by the user and they all can have a custom icon-image using an uploaded image. This image can also be changed on…
Patrick
  • 367
  • 1
  • 13
0
votes
1 answer

How to fix "Error: Unable to create renderer for layer: undefined"?

I am trying to add a layer to my map using openlayers 5 (loaded through npm package ol@5.3.3) and I get this error message in the browser console. Has anyone come across this error and managed to solve it?
user608861
  • 21
  • 2
0
votes
1 answer

How can I change icon source dynamically

I've the below code var content = document.getElementById('popup-content'); var center = ol.proj.transform([44.6753, 25.7136], 'EPSG:4326', 'EPSG:3857'); //initial position of map // ol.proj.fromLonLat([44.6753, 25.7136]) var view =…
Hasan A Yousef
  • 22,789
  • 24
  • 132
  • 203
0
votes
1 answer

How to create custom tiles that fit on a certain extent OpenLayers5

I want to create a custom tile that is a perfect fit on a certain extent. For example, I want to be able to map it on the map at exact spots of an Open Source Map. I saw this example, but it does not explain how the tiles are made and how to make it…
Ashim
  • 877
  • 2
  • 12
  • 22
0
votes
1 answer

How do I Convert an OpenLayers Polygon to a Circle?

I have a drawing feature where, as in one case, a person can draw a circle using the methodology in OL docs example. When that's saved, the server needed to be have it converted to a polygon, and I was able to do that using fromCircle. Now, I'm…
jktravis
  • 1,427
  • 4
  • 20
  • 36
0
votes
0 answers

Openlayers ImageWMS constructor not reading BBOX parameters

I am trying to use the DrawExtent interaction in OpenLayers5 to define the BBOX parameter of a WMS/WCS request to Geoserver. Using this technique I am able to retrieve the image subset I need with a custom WMS url, but when I set the BBOX in the…
0
votes
1 answer

Tile Size remains the same as default which is [256,256] in OpenLayers

I am trying to add a custom layer using XYZ source on the Open Street Map. I want to add it to a certain coordinate. I want to change the tile size to a different value than the default value. I am not able to change the tile Size to any…
Ashim
  • 877
  • 2
  • 12
  • 22
0
votes
1 answer

How to add ol.format.filter dynamically in js?

I'm working on a project which consumes Openlayers and geoserver, My aim is to zoom to the countries I assign to user. Currently I'm achieving it by adding a filter like ol.format.filter.equalTo('country', 'India'), but the problem is if I assign…
krishna lodha
  • 381
  • 3
  • 9
0
votes
1 answer

How to limit drawing inside existing polygon using OpenLayers

Little intro: I want to limit drawing inside existing polygons using snap interaction on restriction layer. I implemented condition on draw interaction that checks if the features of restrictive source are available and if they are then enable…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
0
votes
0 answers

How to change tileSize in XYZ (tileLayer) from default([256,256]) to something else for openlayers?

I am trying to change the tile size for my TileLayer in openlayers and I have not been able to change it. No matter what I set the tileSize to be it is always [256,256]. Also, The files I am getting from local_url is 1900x1268. Below is the…
0
votes
1 answer

Display features returned by WFS within OpenLayers hand drawn bounding box

I allow the user to draw features, and on drawend I need to make a request to my WFS service to return features. I can get the WFS to return data based on the extent using: let vectorSource = new VectorSource({ format: new…
Phish
  • 774
  • 3
  • 11
  • 27
0
votes
1 answer

How to match Openlayers source and layers?

Opanlayers current version has layer and source objects to view vector or tile images. Layer Types: Image, Tile and Vector Source Types: ImageWMS, TileWMS, Geojson, OSM, Raster, Vector, … So how can I decide which source Works with which layer? I…
barteloma
  • 6,403
  • 14
  • 79
  • 173
0
votes
1 answer

Multiple ImageLayer with RasterSource not visible

I am trying to add multiple Openlayer image layers (Using raster source) with different extents to a single Map. If I add a single layer, It is shown but adding multiple does not show either. I thought zindex is the issue which I tried to change…
dementor
  • 85
  • 6
0
votes
2 answers

Having openlayers load data from layer with visible = false

I have a Vector Layer with a Vector Source that is very expensive to load, but not so expensive to render. I have a button im my GUI to toggle the visibility of the layer. The problem is, the first time the visibility is set to true, the loading…
0
votes
1 answer

How do I automate view.animate in OpenLayers5?

I have a list of coordinates I want my code to pan through. I can place view.animate and do it once to pan from my current center to the first coordinate but not to keep cycling through the list. Any ideas? I got the idea from this…