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
5
votes
4 answers

Openlayers map not using full width

I am using openlayers on Angular to display a map with here-api as the map tile provider. Openlayers 6.1.1 Angular 8.0.0 However, when the page is loaded the map does not fill the whole width. This happens on Edge & Chrome for Windows (PC), and…
Glenster
  • 1,187
  • 2
  • 13
  • 31
4
votes
1 answer

When trying to import GeoTiff source in openlayers get error TS2304 AbstractDecoder

When I try to compile my web application using Angular 12 and Open layers if I try to compile the code with the line import GeoTIFF from 'ol/source/GeoTIFF'; I get 2 errors. Error: node_modules/geotiff/dist-node/geotiffimage.d.ts:67:118 - error…
Jack Duffy
  • 193
  • 12
4
votes
1 answer

Typescript alias with dot

I have following imports (in the same TS source file): import {Vector as sourceVector} from "ol/source"; import {Vector} from "ol/layer"; Here is how Vector is exported in ol/source: export { default as Vector } from './source/Vector'; And…
tillias
  • 1,035
  • 2
  • 12
  • 30
4
votes
1 answer

How can I assign a unique identifier to OpenLayers layers?

Does OpenLayers library come with a way to assign/get a unique identifier for layers added to a map, or should I have to implement it myself? This question arises from my need to uniquely identify various type of layers I add to my map (LayerGroup…
umbe1987
  • 2,894
  • 6
  • 35
  • 63
4
votes
2 answers

Cypress with OpenLayers - how to simulate ctrl + mouse drag

I'm trying to simulate ctrl + mouse drag on an OpenLayers map with Cypress. The only way I've managed to get OpenLayers to register click/Cypress events (for example, clicking to create a feature) is with .click() e.g. cy.get('#map').click(845,…
edant92
  • 694
  • 8
  • 18
4
votes
2 answers

Adding map markers to Open Layers 6

My question is simple: How do you add a marker at a specific longitude and latitude? Working through the open layers example page I have created a new map with a marker. I added the marker using the new ol.Feature but it seems no matter what I set…
DreamTeK
  • 32,537
  • 27
  • 112
  • 171
4
votes
1 answer

Difference between OpenLayers 5 and OpenLayers 6

Quick question regarding upcoming release of OpenLayers 6. Does anyone know what are the main differences between OpenLayers 5 and OpenLayers 6. I read something here but additional questions arose: Is it true that OpenLayers 6 will be complete…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
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
3
votes
2 answers

Drawing S57 symbols onto Leaflet or Openlayers map

I have been working on getting leaflet (or openlayers) to be able to display S-57 data (also known as ENC) symbols (Known as S-52) onto the map. I know that leaflet can place svg data onto a map, but I haven't seen these symbols being used as…
Manny K SoSo
  • 31
  • 1
  • 5
3
votes
1 answer

Openlayers 6 offline local vector pbf files "Unimplemented type: 6" error

I'm trying to convert OpenStreetMap data (osm.pbf file) to "z/x/y.pbf" folder/file structure and show the map offline using Openlayers 6 and Ionic. What I did so far is: Downloaded osm.pbf file…
Exerlol
  • 241
  • 3
  • 14
3
votes
0 answers

Openlayers 6 TypeError: URL.createObjectURL is not a function

I have a question, after i update the openlayers from 5.3.1 to 6.3.1, when i run test, jest or mocha, both show the error "TypeError: URL.createObjectURL is not a function", what is the reason? Mocha-Webpack: TypeError: URL.createObjectURL is not a…
3
votes
1 answer

How to get canvas from postcompose event of map in openlayers 6

We are using openlayers and in version 5.3 we were using this construction: map.once('postcompose', async(event) => { let canvas = event.context.canvas; // doing something with canvas } But in openLayers 6.0 the argument context is undefined…
Gal
  • 182
  • 3
  • 12
2
votes
2 answers

how to deactivate zoom on double-click using setActive(false)

i would like to modify the below code in a such way that it only deactivate the zoom on double-click event please. i tried the below posted code, but it disabled all the interactions including the…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
2
votes
1 answer

OpenLayers, clusters with touching polygons. How do I show them separately when zooming in?

Zooming in on clustered polygons that touch each other will not show the polygons. I'm using OpenLayers 6 to show a number of suburb polygons. Clicking on the polygon will show some details about that suburb. It is using clustering, which generally…
Flappie
  • 23
  • 4
2
votes
0 answers

OpenLayers: How to hover over a raster (GeoTIFF) layer and return pixel value

How can I create a tooltip or mouse-over hover to return real data pixel values from a raster GeoTIFF source in Open Layers? Thanks.
bedr
  • 21
  • 1
1
2 3
27 28