The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [openlayers]

Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later

Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Understanding OpenLayers Multi-Select

I'm having trouble filling in the missing gaps of this OpenLayers 5 example: https://openlayers.org/en/latest/examples/select-multiple-features.html?q=select there's a selected array that they push ...
-1
votes
0answers
12 views

Basemap rendering speed in Geoserver [on hold]

I want to create a simple basemap for my project using OpenLayers and GeoServer. My basemap only contains lands and water areas for a small island country. Here’s what I did: 1.     Get land and ...
0
votes
0answers
23 views

Transformation matrix error when initializing the map

I use openlayers 6 in my project. When initializing map I get this error in browser: Uncaught AssertionError: Assertion failed. See https://openlayers.org/en/v6.0.1/doc/errors/#32 for details. at ...
-2
votes
0answers
16 views

KML To Layer [060515_10152019] ERROR In ArcMap 10.4? [on hold]

I have a problem in conversion of kml file. Can anyone help me?
0
votes
2answers
35 views

Checking if selected features are adjacent using OpenLayers [on hold]

I need to be able to merge features on the condition that the selected features are adjacent to each other. How can I achieve this using Open Layers version 5?
0
votes
0answers
1k views

OpenLayers 5: XXX.getFeatureInfoUrl is not a function [on hold]

I am trying to add functionality to retrieve feature attribute information for an image layer with OpenLayers 5 and getFeatureInformationUrl (I eventually want to add functionality to retrieve feature ...
2
votes
1answer
51 views

How to load GeoJSON data in OpenLayers?

I'm using GeoServer for serving map in the GeoJSON format. I din't find any working example. Here is my code snippet. <!doctype html> <html lang="en"> <head> <link rel="...
0
votes
0answers
28 views

Displaying map using GeoServer and OpenLayers [on hold]

I'm using GeoServer and I want to display with clickable same as below. Do I need to use query or some other method? Do I need to split my shape file according to province name? I've single shape file ...
0
votes
0answers
20 views

Unable to preventDefault inside passive event listener due to target being treated as passive: Openlayers 2

I am getting the following error messages: How do I define add control and prevent passive event listener? Below is the code: <!DOCTYPE html> <html lang='en'> <head> <meta ...
0
votes
0answers
44 views

Big set of layers combine with npm+webpack. OpenLayers

I have a really big set of layers in OpenLayers 5. I wonder how to split large source files into smaller sets and combine it via webpack. style.js file about 30 items e.g.: var s_al_timeout = ...
1
vote
1answer
31 views

turfjs cannot detect all self intersections

I am working with OpenLayers/Turfjs to detect self intersection in users manually drawn polygons on a web map. The function that detects the self intersection is a property of the condition of the ...
1
vote
0answers
29 views

Uncaught Reference Error: init is not defined

I am getting the above error on my HTML file @ line number 22. I tried several attempts and was unable to resolve it. Here is the HTML code: <!DOCTYPE html> <html lang="en"> <head&...
1
vote
0answers
18 views

2D canvas library for OpenLayers. Drawing custom interactive objects

I am looking for the 2D canvas library like Konva.js that I can use above OpenLayers 5.x. I need to draw shapes with font inside that are interactive - can be dragged over the map to the appropriate ...
2
votes
1answer
44 views

Display ESRI MapService (WMTS) with EPSG:28992 coordinate system in OpenLayers web map with OpenStreetMap base layer

ESRI MapService https://tiles.arcgis.com/tiles/nSZVuSZjHpEZZbRo/arcgis/rest/services/Historische_tijdreis_1870/MapServer have EPSG:28992 coordinate system. In QGIS I can add this layer via WMTS https:/...
0
votes
0answers
36 views

OpenLayers performance issues adding features to vector layers

I have a fairly standard looking setup (standard in my eyes) but my performance is dreadful. My issue is that any fix stands me up for a fairly large reactor so I was hoping to get some advice. I ...
0
votes
1answer
25 views

OpenLayers 5.3 selected point feature does not return properties, but polygon does

I am having some issues in OpenLayers 5.3.0. The context is that I'm using Sharepoint lists as a backend to save feature data and OpenLayers is running in a Vue.js container. Everything works as ...
1
vote
0answers
27 views

OpenLayers 4 get style from GeoJSON not find

We created an API that returns a GeoJSON in accordance with this styling guide but then OpenLayers doesn't find the style key once I want to style each feature, here my code var appLayer = new ol....
0
votes
2answers
53 views

qgis2web Initial view problem

I used QGIS and its qgis2web plugin to create a web map, using the Openlayers option (from Tom Chadwin and those who helped him!). I got everything working great, except, the initial view goes to 0 ...
0
votes
0answers
31 views

Openlayers 5 adding GeoJSON point layer using geolocation-orientation as base

I am using the example geolocation-orientation script as a base. (it is really awesome!) I want to add a GeoJSON point layer, but am confused about where and how to add that layer. The marker should ...
1
vote
0answers
35 views

Draw and GeometryFunction (OL5 - Typescript)

I'm trying to update my OL3 code (javascript) in OL5 (typescript) and I don't know how to fix this "GeometryFunction". Do you know how to build the GeometryFunction object? var myDraw = new Draw({ ...
0
votes
0answers
33 views

Degradation of the quality of a raster after publishing to GeoServer [duplicate]

I'm trying to publish a satellite raster (.tif) into GeoServer and display it in a web application using OpenLayers. I tried to use many procedures but without any good results. This is the original ...
0
votes
0answers
35 views

Display GeoTIFF layer from GeoServer in OpenLayers

I have a number of GeoTIFF files to be published in GeoServer and consume in OpenLayers. I have published vector data and able to consume them in openlayers, However I am not able to show a sample ...
1
vote
1answer
25 views

Add GeoJSON features from an API call in OpenLayers 4, layer not displayed

I'm trying to create a little demo to show the data from our API into a map but I cannot see my layer Here my code, is just basic for the moment, we just need to display the data: const projection = ...
0
votes
0answers
21 views

Add GeoJSON features from an API call in OpenLayers 4

I'm trying to create a little demo to show the data from our API into a map but I have all the time the error: Uncaught TypeError: feature.getId is not a function Here my code, is just basic for the ...
0
votes
0answers
24 views

How to add a vector layers to my map using OpenLayers 3?

I'm trying to add a vector layer manually to my map but i receive this error: Uncaught TypeError: b.attachEvent is not a function the code is : // adding data // Define Geometries var point = new ...
0
votes
0answers
18 views

Choose automatically PDF format for a fixed scale and layer extent

In my old post I was able to export my map in a fixed scale and choose a PDF format(A0,A1..) to export a vector layer, but when I choose a big scale (1:2000) and I choose a small PDF format (A4) I get ...
0
votes
1answer
26 views

Export OpenLayers map to PDF with fixed scale and different PDF formats

I want to export my OpenLayers Map to PDF with custom scale and PDF formats (A0,A1..), so I implemented the answer in this post. On a separate basic page it worked but when I tried to implement it in ...
0
votes
0answers
26 views

Adding vector layers to map using OpenLayers?

I'm trying to add a vector layer manually to my map using OpenLayers 3 but I receive this error: Uncaught TypeError: b.attachEvent is not a function The code is : // adding data // Define ...
0
votes
0answers
21 views

osm_planet_point doesn't display CSS style from GeoServer to OpenLayers (WMS and TWS using mapproxy)

I use this CSS code on GeoServer, for displaying name of populated places (cities, towns, etc): [@scale <10000000] [place = 'city'][capital = 'yes']{ label: [name]; fill: #dadada; ...
1
vote
0answers
19 views

Openlayers GeoJSON reprojection issue 4.3.3 vs 5.3.0

While switching from ol 4.3.3 to 5.3.0 I encountered a problem. The WMS layers work as I expected (display in the right location), geojson data don't. I read all the data from the same service in ...
0
votes
0answers
51 views

Clip the BBOX coordinates

Is there any control on BBOX to clip the coordinates before sending request to the GeoServer. The allowed coordinates are [-90, 90, -180,180]. The issue is when ZoomIN/out the BBox calculating the ...
0
votes
1answer
29 views

How to use Mapbox geocoder in OpenLayers application?

I want to use Mapbox geocoding services in OpenLayers 5 project. I'm using this method https://github.com/jonataswalker/ol-geocoder but it doesn't support Mapbox API
1
vote
1answer
31 views

OpenLayers: map with popup and marker cluster

I'm trying to create a map with marker cluster and popup using Openlayers 5. I'm be able to show a popup on click as you can see below but when I try to use marker cluster the contents are no longer ...
2
votes
0answers
33 views

Select interaction for each layer is not working in OpenLayers

I have multiple layers in my OpenLayers application. I need layer based specific info Windows. Each layer will have its own select interaction. This is my problem. I do not want to add layers in one ...
1
vote
1answer
23 views

Pop up appearing blank after JSON parse?

My aim is to retrieve the attribute list of a WMS layer. The concept is to fetch it as JSON data, then parse it and display it in a pop up. I am using OpenLayers3 with local GeoServer and JavaScript. ...
0
votes
1answer
58 views

GeoServer - longitude/latitude is out of bounds

We could see the below error from GeoServer when zooming out the map, because the bbox sending request more than the MONGO DB accepted range(-180,-90,180,90). "Query failed with error code 2 and ...
0
votes
1answer
18 views

How to stop requesting tiles after a certain zoom level in OpenLayers

I am using OpenLayers to create a map. The base of the map is being created using XYZ as the source. I only have till certain zoom level and i was wondering if there is any way to make the browser ...
1
vote
1answer
19 views

OpenLayers-v5: How to get WFS features before vector layer is visible

I expected a WFS call to be made when a Vector Layer was added to the map, but it doesn't happen until the layer is marked as visible. Here is how I'm currently creating my vector layers. The visible ...
0
votes
1answer
20 views

Calculate feature extent OpenLayers?

I have a feature created from Well Known Text as following: var feature = format.readFeature(wkt , { dataProjection: 'EPSG:25830', featureProjection: 'EPSG:25830' }); When I add it to a ...
0
votes
0answers
12 views

Converting feature from draw interaction to WKT string

I've problems with converting the feature which I'm getting in draw interaction into the WKT string. I saw multiple examples which looks like it should be simple but I'm always getting the following ...
0
votes
0answers
21 views

Cannot load GeoJSON in OpenLayers 4.6.5

Using just a simple test case, I cannot load GeoJSON into OpenLayers. I've used a base case, with a simple polygon and yet cannot load it. If anyone has any ideas please let me know. I have created ...
1
vote
0answers
20 views

Changing features attributes in OpenLayers

I am using OpenLayers 5.3.3 and I want to change attributes of the specific feature in my map in OpenLayers. After changing the features I want to the changes to be updated in my map. this....
0
votes
0answers
20 views

Icons/Features disappear after removing one feature from vector Source

I am using OpenLayers 5 and i have a map which has multiple icons. When i try to remove an icon from my map, all the icons disappear at once. Code Below is to add the vector source which contains ...
0
votes
0answers
32 views

Trying to add feature to vector source but getting an error in version 5.3.5

I am following openlayers documentation and from this webpage: https://openlayers.org/en/latest/apidoc/module-ol_source_Vector-VectorSource.html#addFeature I understand that the features option can ...
0
votes
1answer
49 views

Getting attribute list of a particular WMS layer and display it as a popup in OpenLayers3?

I have an OpenLayers3 map with two layers provided from local GeoServer.My requirement is to get the attribute list of one layer and display it as a pop up inside the map window. To achieve this, I ...
1
vote
0answers
16 views

WFS-T insertion problem OpenLayers3

I am trying to send my drawn features with WFS-t to DB. This particular layer has two columns in DB ogc_fid(which is autoincrementing primary key) and wkb_geometry (type geom, which is my geometry ...
1
vote
1answer
25 views

Marker shows as a dot instead of the icon image in openlayers

i am trying to add icons on my map using features but instead of showing the icosn i get a dot on the map in that position. let map = new Map({ target: "map", layers:[ new TileLayer({ source: OSM(), ...
1
vote
1answer
21 views

OpenLayers map fill full screen?

I have an OpenLayers map with the following css: .map { height: 100%; width: 100%; } However the map does not fill the whole screen, and it stays like this (take a look at the bottom): ...
0
votes
0answers
34 views

Swipe option between layers (OpenLayers webmap exported from QGIS)

It is possible to export web map (using qgis2web) and then add the "swipe" feature like this: https://openlayers.org/en/latest/examples/layer-swipe.html? I'm newbie in JavaScript developing. If it is ...
1
vote
1answer
24 views

Image with background as feature style

I'm working on project that uses Open Layers. I have a problem with styling some features. Is it possible to set as Style image and also specify fill and stroke for it, for example background of the ...