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

Updating singleton value not reflected in AGM Map

I am trying to programmaticly set the Zoom level for an AGM map. If I... HTML
1
vote
1 answer

How to import and use control.defaults in Angular?

I'm very new in Openlayers and I'm trying to create my first map component. I'm trying to set the map controls but without success. The code throws an error when try to import the 'ol/control'. I saw a lot exemplo using defaultControls, but not in…
1
vote
2 answers

OpenLayers 5 - is there a way to center cluster text?

I'm making app that displays my markers, and because there is a lot of them I need to make clusters. Everything but text works as expected. I've tried changing anchor and anchor[X/Y]Units but even if i change it to a fixed pixels it always renders…
Pascal
  • 43
  • 7
1
vote
1 answer

Openlayers - WMS layer: how to get the time dimension from a specific layer

I'm trying to load a WMS-layer. Using the current ISO-8601 Time the layer is showing, but I also want to be able to set different Date/Times. In order to use Date/Times that are within a certain range I need to retrieve the Time Dimension through…
user1939338
  • 117
  • 9
1
vote
0 answers

Problems with openlayers 5.3 and heatmap-layer (tiles look defect)

I have some problems with a heatmap-layer in OpenLayers5.3.0. When I zoom deeply in my application I need some very high blur- and radius-values: if (zoom==14){ heatmap.setBlur(60); heatmap.setRadius(parseInt(160)); } ..therefore the tile…
DocKalle
  • 11
  • 2
1
vote
1 answer

Is it possible to define the effective viewport area for a view in OpenLayers 5?

The OpenLayers example “Advanced View Positioning” (https://openlayers.org/en/latest/examples/center.html) shows how to create a “view inside a view”. If you examine the example, it uses a padding passed to view.fit(). The problem I see is that…
Ricardo
  • 180
  • 2
  • 12
1
vote
0 answers

I want make ol.js file. How to make full package ol.js?

I want to make ol.js, like ol cdn file or result of v5.3-dist. Example, provided ol site, is not i want. Ol example just make application, part of ol. I want full ol.js. How to make ol.js? webpack? parcel?
JHKWUN
  • 21
  • 4
1
vote
2 answers

Openlayers how to update overlay position on map moveend event

I have a Point feature of type ol.geom.Point on openlayers map and there is a popup which I am displaying on clicking the feature. The popup is
element which I have added as an overlay, I am displaying and hiding the overlay whenever I find…
1
vote
0 answers

Preload static images.......how to?

Another problem I have........I know how to preload images using jquery, but how can preloading be done with static images? IMG_LYRbounds = [45.3, 30.9, -14.6, 72.6]; // LON/LAT url = "http://localhost/img/myupdatedimgXX.png"; IMG_LYR = new…
user1939338
  • 117
  • 9
1
vote
0 answers

Connect vector using Parcel

In OpenLayers v5.3.0 using Parcel does not connect the vector layer from a local location. This code with local URL does not work: import GeoJSON from 'ol/format/GeoJSON'; import Map from 'ol/Map'; import VectorLayer from 'ol/layer/Vector'; import…
1
vote
1 answer

Make boundary for ol static image

I'm using ol v5.3.0 for view static image. I want to bound the image for the size of the ol div. When the image minimize more than the div size the will not minimize anymore. I tried to use the projection attribute of the static image with the…
Ezri Y
  • 407
  • 3
  • 15
1
vote
1 answer

Load external geojson file in OpenLayers 5.3.0

I have a problem loading external geojson file in OpenLayers 5.3.0 with the ol package. I installed it via npm. Here's the code: import 'ol/ol.css'; import Map from 'ol/Map'; import View from 'ol/View'; import GeoJSON from…
dusanz
  • 13
  • 1
  • 4
1
vote
1 answer

OpenLayers automatically style line features

Is there any way to automatically style each feature read from a GeoJSON File and used as a source for a vectorlayer differently? I’ve attached a screenshot: This mess of green line features is more than confusing. It would be nice for each line to…
karkraeg
  • 445
  • 4
  • 18
1
vote
1 answer

Get extent on all layers in Openalyers 5

I'm trying to do quite a trivial activity: fit a map to the extent of all layers. But I'm stuck: Here is my code: import { createEmpty, getWidth, getHeight, extend } from 'ol/extent.js'; function centraTuttiLayer(map) { var extent =…
massimoi
  • 324
  • 4
  • 11
1
vote
1 answer

how to get style from layer in geoserver

I would like to get style (sld or css does not matter, but prefer css) from sql view layer but I couldn' t achieve this. here is my sql view for layer select value, location, 'mark: symbol(square);mark-size: 6px;:mark {fill: #0099cc;}'…
demdem
  • 182
  • 3
  • 14