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
1
vote
1 answer

Creating an OpenLayers 5 MultiPolygon feature from a turf.js MultiPolygon

In OpenLayers 5.3.0, I've created a MultiPolygon using the 'difference' tool in turf.js. The turf.js MultiPolygon looks fine when I examine the JSON, but when I try to use that to create a feature in OpenLayers, I get "Uncaught TypeError:…
Gareth Jones
  • 517
  • 1
  • 10
  • 25
1
vote
2 answers

The Observer seems not to be executed whenever the observable is changing its value

The observer seems to initialize the subscription just fine. However, when the value of the layer changes the observer doesn't execute the function it supposes to. Am I missing something? You can check my repository on…
1
vote
1 answer

Open Layer Features Click Event

How can I add an event on OpenLayers Feature using Feature on method? It doesn't work for me. import { Map, View, Feature } from 'ol'; import {getVectorContext} from 'ol/render'; import TileLayer from 'ol/layer/Tile'; import * as layer from…
Rabindra
  • 11
  • 2
1
vote
0 answers

Why have I to create a useless Source in my OpenLayer's add on library to see my drawings?

I am creating a small Open Layers Addon library with some common style and interaction to use it across some applications. So I create this library in Typescript, and I use webpack to bundle It. Today, my library is a single class as follow : import…
Adrien BARRAL
  • 3,474
  • 1
  • 25
  • 37
1
vote
1 answer

How do I correctly set a circle's radius in OpenLayers for a specific unit of measure?

I'm trying to create a circle with a specific on-the-ground radius in OpenLayers v5. But I do not seem to understand how to create it with a specific unit of measure such as meters, miles, etc. The radius argument in the constructor appears to be…
jktravis
  • 1,427
  • 4
  • 20
  • 36
1
vote
1 answer

Using a vector layer as an input to a raster source in openlayers

I'm trying to use vector features as a mask for a raster source in Openlayers 5. (I want to do calculations on raster data only within specific jurisdictions, which are dynamically selectable by the user.) To do this, I tried to use the vector layer…
1
vote
1 answer

How to make a marker dragable in openlayers 5 without triggering drag when I click marker

The problem is, when i click on the marker, then translate event is also triggered and infowindow popup will be started twice. How to stop triggering onclick event ? Click code map.on("click", function (e) { …
user2573099
  • 63
  • 1
  • 6
1
vote
0 answers

Is it possible to use VIEWPARAMS in GeoServer MapBox VectorTiles layer?

Here is the code which i am using to load vector tiles.I have verified already that VIEWPARMS is going through URL but not getting response as per VIEWPARMS. Results are coming as per default value configured in geoserver. new…
Munna Bhakta
  • 353
  • 3
  • 14
1
vote
0 answers

How managing the display order of layers

groupLayerMarker is always under other layers so user can't see markers map Collection:[] I get data and create groupLayerMarker groupLayerMarker: [layerMarker, layerMarker ,...] Collection: [groupLayerMarker], loading layerOsm Collection:…
gomez119
  • 11
  • 2
1
vote
1 answer

Color overviewMap according to mainMap

I need to color the area of the overview map which has been visited in the same map for the last zoom only. I am able to get the extent to color and am able to append ImageLayer to the layers but over time layers increase a lot and the browser…
dementor
  • 85
  • 6
1
vote
0 answers

OpenLayers displays skewed polygons

I have a PostgreSQL / PostGIS database with polygons (which represent rooms of a floor in a building) in it. When I try plotting them using matplotlib (directly from database) or mapshaper (from a shapefile containing the polygons), the output looks…
1
vote
0 answers

How to restrict the openlayers fullscreen in browser only

The default openlayers fullscreen api covers the entire window when clicked on the fullscreen control in openlayers map. Is there a way to control this behaviour and allow the fullscreen to expand only in the browser body so that user can still see…
capnam
  • 429
  • 9
  • 25
1
vote
0 answers

Openlayers - ol is not defined

I'm trying to run the map, with this code: var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ], view: new ol.View({ center:…
KaBe
  • 11
  • 1
  • 5
1
vote
1 answer

TileWMS' not showing after upgrading OpenLayers from 4.6.5 to 5.3.0

I had an OpenLayers 4.6.5 application, which showed a map, and on top of that had the option to turn on and off some overlays. The overlays are of the type TileWMS, and seemed to work perfectly. At first i got called OpenLayers remotely like…
Anders Jensen
  • 330
  • 3
  • 20
1
vote
0 answers

How can I use Openlayers5 with ionic-angular

The problem is that I am using Typescript 3.4.3 and the OpenLayer API is been documented only for Javascript. Somewhere I found that I need to install @types/ol": "^5.3.3" in order to use Openlayer with Typescript. I have the following code but I do…
skassi
  • 79
  • 8