Skip to main content

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
0 answers
21 views

OpenLayers - disable control that includes clicks on the map

In my project I have several controls that interact via clicking on the map so I have to deactivate them selectively to use one at a time. What is the correct method to deactivate a control that ...
andreaordonselli's user avatar
0 votes
0 answers
41 views

Position the labels centrally in qgis2opengis / qgis2web (OpenLayers)

In my case: qgis2opengis export (problem also with OpenLayers export from qgis2web) As it is not possible to make settings for label positioning via QGIS, editing must be carried out in openlayers ...
juko's user avatar
  • 634
0 votes
1 answer
54 views

OpenLayers 9, distance between lines

The getDistance method of OpenLayers expects two points. I couldn't find a generic method for lines, so I made the following: import {getDistance} from 'ol/sphere'; export default class Utils{ ...
pkExec's user avatar
  • 314
0 votes
0 answers
20 views

Passing style to GeoServer layer group

We have two layers from PostGIS views defined in Geoserver Layers, the district layer will be overlayed on the point layer, and we defined the point layer with total three styles, we are able to pass ...
SpiderMan's user avatar
0 votes
0 answers
36 views

Vue3 and OpenLayers draw on map not showing up [closed]

Albeit a point moves with the mouse on the map as intended, by clicking on the map the point does not show up. I followed the example in OpenLayers and try to implement it as a Vue component: https://...
bluePlanet's user avatar
1 vote
1 answer
38 views

Basemap with one selector

I would like the base maps to have a single selector instead of the classic check that turns it on and off, is it possible as in this figure?
Vlademir Sazon's user avatar
0 votes
1 answer
38 views

Groups within group on qgis2web

I have several layers of polygons, each have defined symbologies. I want to make some layers merged into one group and then put it as a subgroup in another group. Now when I export this on qgis2web ...
Vlademir Sazon's user avatar
0 votes
1 answer
39 views

Subgroup toggle in qgis2web

When you export a map to a webmap through qgis2web, you have a checkbox in the legends to toggle on/off each layer. However, I have a categorized symbology and I want to be able to put checkboxes on ...
Vlademir Sazon's user avatar
0 votes
1 answer
35 views

Polyline from coordinates array in OL v9.2.2

I'm trying to implement something like this example in Angular 17. I can't replicate this part: const polyline = result.routes[0].geometry; const route = new Polyline({ factor: 1e6, }).readGeometry(...
Tatoh's user avatar
  • 3
-1 votes
0 answers
31 views

In OpenLayers with Layer Group added from GeoServer, No features found with click event using map.getFeaturesAtPixel

Used GeoServer Layer Group (Tile). Basemap layer is OSM. Tile layer's projection is UTM. View projection is 4326. map.on('singleclick', function(evt) { var features = map.getFeaturesAtPixel(...
J Subramanyam's user avatar
1 vote
0 answers
23 views

Control feature order or z-index for WebGL layer icons? (OpenLayers)

I want to control the order icons appear on a WebGL layer so icons in the north appear in the back and overlap to the front as they appear southwards. Since the WebGL layer does not have a renderOrder ...
Sidders's user avatar
  • 103
0 votes
1 answer
28 views

OpenLayers zoom to WMS result set

I am using GeoServer with a plugin for a NoSQL backend. I am sending the equivalent of a CQL query to select a portion of a dataset and plot in on the map... like thousands of points. My plotting and ...
juanschwartz's user avatar
1 vote
1 answer
62 views

How to apply style array to WebGL points layer (OpenLayers)

How can I apply an array of styles to a WebGL Points layer in OpenLayers? For example, if I use the following code to apply a circle and an icon, only the icon is visible - so is what I want to do ...
Sidders's user avatar
  • 103
0 votes
0 answers
91 views

How to remove GeoTIFF overlays certain geometry on the map

As shown in the below posted code, I instantiate an object from GeoTIFF class with configurations shown below. At run time, the tiff image overlays the desired geometry, but I can not remove it. In ...
Amr's user avatar
  • 43
1 vote
1 answer
45 views

Panning during draw interaction breaks tracing of the draw interaction in OpenLayers

I have a draw interaction where I draw on an existing linestring feature in an Angular application. I start the draw interaction with tracing active to this linestring. When i pan after starting the ...
Joachim's user avatar
  • 13
0 votes
1 answer
64 views

Eliminate any pixel of a GeoTIFF that does not intersect with the geometry/feature in OpenLayers?

As shown in the below posted code, I am trying to overlay particular geomerty/feature with a GeoTIFF, the code posted below succeeded in achieving that. However, as shown in the below posted screen-...
Amr's user avatar
  • 43
0 votes
1 answer
70 views

How to accommodate geotiff overlays a geometry/feature on the map

as shown in the below posted screen-shots, the one titled digit-area represents the geometry the user selected on the map. for the one titled tiff-overlay it should represent the geotiff repective to ...
Amr's user avatar
  • 43
0 votes
0 answers
23 views

How to overlay the map with blob object of a TIFF file

As shown in the below posted code, I am trying to instantiate an object from GeoTIFF class and set a blob to the blob object. The blob contains data as shown in the section blob contents below. When I ...
Amr's user avatar
  • 43
0 votes
0 answers
28 views

Uncaught TypeError when adding OpenLayers Measure tool to App

I am trying to add the Measure tool from Examples to my map application and keep getting the following error. Uncaught TypeError: Cannot read properties of undefined (reading 'getLayers') at ...
gwydion93's user avatar
  • 1,903
0 votes
0 answers
53 views

How to overlay the map with a TIFF file

As shown in the code posted below, I have a .tiff file and its path is stored in pathToTIFF variable, and I want to have it overlaid on the map. At run time, the below posted code crashes and i ...
Amr's user avatar
  • 43
0 votes
1 answer
29 views

Openlayers 4.6.4 version vector layer with 150 features not working when we dynamically set text only in Chrome laptop/ PC

I have map with a layer consists of more than 150 features. I'm setting text dynamically for each features. For some reason, the texts are not rendered as expected only in Google Chrome of laptop. I'm ...
Suvethan Nantha's user avatar
0 votes
2 answers
86 views

Change style for selected feature in OpenLayers

I need to change the style of the selected feature and allow the user to also change all features if they do not have any selected. My problem is when the user set the new style, all the features have ...
Nicolas Svaiger's user avatar
0 votes
0 answers
28 views

Can the properties of the Snap event tell why sanp event lister call back does get executed despite snapping occures to edges and vertices

I register for Draw, Modify and Snap interactions as shown below in the code. The interactions added to the map are working except the Snap. to debug this issue, i printed the contents of this.#...
Amr's user avatar
  • 43
0 votes
0 answers
35 views

MapProxy and Mapnik missing layers for some tiles only

I'm using MapProxy to serve OSM tiles rendered by Mapnik and displaying them using OpenLayers; in general it seems to be working but the problem is that at all zoom levels some of the tiles seem to be ...
Phil's user avatar
  • 1
1 vote
1 answer
89 views

Transform GeoJSON from EPSG:31983 to EPSG:4326 in OpenLayers

I have code in OpenLayers, which allows you to draw geometries on a layer and then download the file in GeoJSON format. Here's the code: function downloadGeoJSON(content, fileName, contentType) { ...
Andreia Gusmao's user avatar
1 vote
1 answer
40 views

Snap interaction not working before first point drawn in OpenLayers

I'm trying to add snap interaction to map using OpenLayers. Snap works on draw but only after drawing first point of polygon. Is there a way to make it snap while starting to draw the polygon? I tried ...
Smita Verma's user avatar
1 vote
0 answers
37 views

OpenLayers add GML32 to map doesn't work

I'm new to this forum, but was thinking someone here could probably help me out. I recently moved from using leaflet to using openlayers. For a new project I want to display the content of a gml file ...
valentinooz's user avatar
0 votes
1 answer
30 views

Cannot set a style to a feature in OpenLayers

As shown in the below posted code, I am trying to make a feature invisible to the user. At run time, I receive the error posted below. Why am I getting this error and how can I solve it? code this.#...
Amr's user avatar
  • 43
0 votes
1 answer
59 views

Show designed map tips instead of the default pop-ups in qgis2web

I continue designing my customized interactive map using the latest version of qgis2web plug in. In this location, I want to display in the exported qgis2web map the map tips I designed with html in ...
DorExplor's user avatar
1 vote
1 answer
45 views

Feature disappears when setting a buffer to a drawn feature with turf.js in OpenLayers

As shown in the code posted below, I am using turf.js to buffer a geometry. The code below shows the steps I took to do the geometry buffering. In the following step: const asOLGeom = ...
Amr's user avatar
  • 43
0 votes
1 answer
56 views

Snap event does not get fired in OpenLayers

I create a snap event as shown below in the code. At run time, when I hover the mouse near by a vertex, the mouse pointer gets snapped/attached to that vertex but the snapevent did not get fired. ...
Amr's user avatar
  • 43
0 votes
1 answer
45 views

Uncaught TypeError: wmsLayers.getSource is not a function

wms appears but when clicked an error appears like this and the popup does not appear I want to use WMS GetFeatureInfo (Tile Layer) whose info is taken from WMS Geoserver to display popup information ...
user238348's user avatar
1 vote
1 answer
23 views

OpenLayers snap to multipoint layer

Implementing snap interaction by getting snap points as features in layer. The draw interaction does not snap to displayed nodes. What is wrong? snap_nodes = MULTIPOINT((350095.29 650021.37),(350097....
Smita Verma's user avatar
1 vote
1 answer
27 views

Adding Multipoint layer OpenLayers for snap interaction

I am trying to implement snap on my map, getting snap nodes as a multipoint wkt as snap_nodes and creating and adding a layer, but the layer doesn't show snap_nodes = MULTIPOINT((350095.29 650021.37),(...
Smita Verma's user avatar
0 votes
0 answers
27 views

OpenLayer setTileLoadFunction gives Access-Control-Allow-Origin error

If I load the same source without the setTileLoadFunction it works fine, but if I load the same tile thru the function below as described in the documentation (https://openlayers.org/en/latest/apidoc/...
Mårten Swärd's user avatar
0 votes
0 answers
14 views

Recent upgrade to 2.25.0 - the OpenLayers map preview not working anymore [duplicate]

Recently we upgraded GeoServer from the stable release Dec 2023 (forgot the number) where everything was working fine to the March 19 stable release. The trouble is the OpenLayers preview shows just &...
user957537's user avatar
0 votes
0 answers
29 views

"clear screen" function clears measurement components but changes the layer order

My work environment: OpenLayers 2.13.1, .Net Razor (*.cshtml), IIS 8.5 and Windows Server 2012 R2. When the "clear screen" function works after making a measurement on the map, the ...
backup's user avatar
  • 1
0 votes
1 answer
59 views

Hide Points of Interest on Google Maps using OpenLayers

I would like to know how to hide the Points of Interest on a Google map using OpenLayers. I will include my sample code below that I have tried to use to do this but the parameters don't seem to work ...
ms4sman's user avatar
  • 11
1 vote
0 answers
26 views

GeoServer incorrectly reprojecting layer

I have my asset data stored in an Oracle 19c spatial database as a table with a geometry column. I've setup a layer in GeoServer in order to overlay my data onto a OpenStreetMap basemap, however, my ...
Farbod Soroosh's user avatar
0 votes
1 answer
70 views

Which method to calculate distance from coordinates

I have a project to know the distance between two points (Long, Lat). The web app uses openlayers (CRS from 4326 to 900913). I have written a jupyter notebook to check the distance in python. https://...
michel webismagic's user avatar
2 votes
0 answers
42 views

Clipping a WebGLTileLayer in OpenLayers

I want to clip a tile layer against a vector geometry (polygon). When using a canvas renderer, there are somewhat well documented solutions to this using prerender and postrender event handlers and ...
Liedman's user avatar
  • 1,093
0 votes
0 answers
18 views

Event listener of removefeature does not get executed when a feature is removed from the vectorsource

As shown in the below posted code, I want to execute some side effects in evtListener when a feature is removed from the vector source. At run time, when deleteSelectedGeometry function is invoked, ...
Amr's user avatar
  • 43
0 votes
1 answer
34 views

Updating OpenLayers ZoomToExtent control

I have OpenLayers control defined like, // Zoom to Extent control var zoomToExtentControl = new ol.control.ZoomToExtent({ extent: [73.19, 15.12, 81.80, 22.77] }); Which will give us Extent button on ...
SpiderMan's user avatar
0 votes
0 answers
56 views

QGIS Webmap Layers Missing

So I am trying to create a webmap in QGIS with the qgis2web plugin that shows an Ortho (saved as GeoTIFF) created from an airplane overlaid on background satellite imagery. I tried using Leaflet ...
Ian Moffit's user avatar
0 votes
1 answer
46 views

How to listen to changes occur when modifying a geometry

As shown in the code posted below, I want to listen to any changes occur when modifying a geometry. The way I registered to the change event does not cause any changes to be listened to. I would like ...
Amr's user avatar
  • 43
2 votes
1 answer
110 views

How do I modify S57 data converted using ogr2ogr so that it correctly exports on qgis2web?

I have some unencrypted ENC charts with file extension .000 (S57 data). Using the process and S52 styles at https://www.sigterritoires.fr/index.php/affichage-des-cartes-marines-s57-dans-qgis/ I have ...
James Davies's user avatar
0 votes
0 answers
84 views

Adjusting layer order in Lizmap

I'm trying to add a WMS layer in Lizmap, but I want the points on the map to appear on top. Currently, when I add WMS layers, they cover the points from other layers on the map. I use this code to add ...
Jakub Zajkowski's user avatar
1 vote
1 answer
63 views

Getting extent of each individual feature in the vector source in OpenLayers?

i have a vectorSource that contains some features.i know how to get the extent of the vectorSource, but i do not know how to get the extent of each individual feature in that vectorSource. i googled ...
Amr's user avatar
  • 43
0 votes
0 answers
68 views

Clip a GeoJSON layer based on polygon drawing

I want to know if is possible clip a GeoJSON layer based on a feature drawn with drawing tools in OpenLayers. I followed this steps (https://openlayers.org/en/latest/examples/layer-clipping-vector....
Juan Pablo Rosset's user avatar
0 votes
0 answers
46 views

Error turf is not defined in OpenLayers

Here is my package.json : "name": "api_geoservices", "version": "1.0.0", "type": "module", "scripts": { "start": "...
Leehan's user avatar
  • 1,234

1
2 3 4 5
74