Questions tagged [openlayers]
OpenLayers is an open source Javascript web mapping library for creating web map applications.
openlayers
5,174
questions
0
votes
0
answers
22
views
OpenLayers display labels on contour lines using WebGL
Using OpenLayers 10 and WebGL, how to render contour lines with labels showing their elevation, spread along their length? Similar to the labels in this picture:
The contour lines are loaded from a ...
0
votes
0
answers
21
views
Openlayers how to dynamically filter layer data with one or more filter values through style variable
I am using latest openlayers version.
I have created layer using WebGLPointsLayer with flatstyle.
I want to build functionality to where user can apply filter to filter data on map.
Below are the ...
0
votes
1
answer
31
views
Change in rectangles after ol-cesium 2.15.0
I am using polygons in my website, built with Openlayers and ol-cesium.
These polygons used to be correct when in 3D (i.e. lines are not supposed to be straight in the 3D view).
This used to work ...
-1
votes
0
answers
28
views
Using the newest 10.0.0 version and ran into rbush being referenced somewhere without ./, ../ or /. Anyone have the same issue?
I want simple OSM map to show up with the new version. Got everything finally working just to get an error in consol stating:
Uncaught TypeError: Failed to resolve module specifier "rbush". ...
0
votes
0
answers
29
views
How to add colorbar legend on openlayers heatmap?
https://openlayers.org/en/latest/examples/heatmap-earthquakes.html
When I reviewed the API documentation for the HeatmapLayer, I couldn't find any explanation about the legend. While searching for a ...
0
votes
1
answer
35
views
Migrate from deprecated XYZ with tileUrlFunction to TileImage with tileLoadFunction
The latest Openlayers documentation states that tileUrlFunction is deprecated in XYZ source. I am trying to migrate to TileImage with tileLoadFunction, but nothing is showing.
The old version is ...
0
votes
1
answer
25
views
Can someone advice me how to convert or upgrade an old openlayers OSM map code?
I set up a couple of web sites several years ago that visualize survey data on clickable maps. Example:
I put a lot of effort into coding at the time and have not developed the sites further since ...
-1
votes
0
answers
30
views
Georeferencing in OpenLayers
I am trying to implement georeferencing in OpenLayers. I've got most of it right. But when there is a difference in aspect ratio and rotation between the source and target control points the results ...
0
votes
1
answer
32
views
Cannot limit TileLayer with minZoom in ol-cesium
I have a map created with OpenLayers and ol-cesium.
I have created a tile layer that should only appear after a certain zoom level:
return new TileLayer({
minZoom: minZoom,
source: new XYZ({
...
0
votes
0
answers
29
views
Maximizing OpenLayers v3 Performance on an Old Browser
I have an application where I use React to render an OpenLayers map (using version 3) in order to display a .mbtiles file served from Tilserver-gl-light. The app functions and does what I want it to, ...
0
votes
0
answers
34
views
How to manage offline vector tiles in an ionic app?
I have an ionic - angular - capacitor app with a map, drawn by openlayers using vector tiles from different online sources (mapbox, tomtom or openstreetmap). I try to add the possibility to use a set ...
0
votes
1
answer
26
views
How can I apply alpha color components in an OpenLayers heatmap gradient?
The code below produces:
However, I have specified that both colors have an alpha value of 0.3, but it is clear that has been ignored.
It is possible to specify an alpha value for the heatmap ...
0
votes
0
answers
29
views
How can I get the expected text size with an SVG Image used in an OpenLayers Icon?
The code below produces the following result for me:
I expected the text to be larger. The current size rendered is nearly unreadable.
Zooming in on the result and measuring the height,
I see that ...
0
votes
0
answers
17
views
I want to get WFS Data from geoserver by POST Method by more than one text by filter using equalTo method In Open Layer
I am new to Geoserver and geographical work so I am struggling to fetch more than one geo-location data (WFS) by one POST request. I want multiple geoJSON location data on one fetch.
My Current Code,
...
0
votes
1
answer
39
views
Read extensions from GPX features (openlayers)
I am trying to insert GPX data on a Vector Layer and want to later read the attributes inside the tag.
This is a small extract from my GPX file:
<gpx xmlns="http://www.topografix.com/GPX/1/1&...
0
votes
0
answers
25
views
Get rgb value data from TileLayer onHover (openlayers)
Goal: visualize large .asc data (2d array data) on the client. More specifically, the user should be able to apply different color-maps and also hover on the point to see its value (at least a good ...
-1
votes
0
answers
43
views
Render large .asc files, with variable colormap
Suppose I have a large .asc file (matrix representing elevation, water depth, ....), in my backend and want to visualize it on the client (with openlayers). The requirements are:
Smooth rendering
...
0
votes
1
answer
42
views
Map loadstart event not firing with vector layers (openlayers)
I have a project in OpenLayers 8.2, where there are many types of layers in a map. As introduced in ol 6.14, I am using the 'loadstart' and 'loadend' events of the map object (https://openlayers.org/...
0
votes
2
answers
56
views
Fontawesome svg-icons in openlayers
I know similar questions have been asked before but their answers don't help me.
I'm trying to use Fontawesome-Icons as markers in an Openlayers map like this:
const svg = `
<svg ...
0
votes
1
answer
54
views
Inverse MouseWheelZoom
There is a project that uses openlayers and react.
I came across the need to invert the direction of the mouse wheel when zooming. More precisely, even be able to switch from standard mode to inverted ...
0
votes
0
answers
45
views
How to provide a circle radius that represents real-world distance on an OpenLayers map?
I want to plot a circular Polygon feature that covers 200 hectares on an OpenLayers map. The projection of the map and data is set to EPSG:3857.
I believe the solution lies in this code (source), but ...
0
votes
0
answers
48
views
adjustments in react leaflet currently done on openlayers
I have an application that uses the openlayers library in react to display a map.
I use an internal raster tile server that has a strange a strange configuration.
all tiles are offset and squished ...
0
votes
0
answers
39
views
Why add a control via OpenLayer's getControls().extend?
I can change the z-index of a div so it appears above the map's viewport div.
Why add map controls via getControls().extend? What does that provide that I may not be accounting for?
Example:
const ...
0
votes
0
answers
49
views
How can I manipulate the overflow property of an OpenLayers view?
The example below will generate the follow image:
The control I have added to the map is clipped. If I increase the height of the map, it will look like:
What I would like to achieve is the ...
0
votes
1
answer
41
views
OpenLayers: optimize rendering on no-GPU platforms by skipping projection and allowing for a custom feature format?
I have an array of trajectories. Each trajectory represents a moving vehicle, and is an object consisting of a unique ID and a set of coordinates which are equally-spaced samples of the vehicle's ...
0
votes
0
answers
35
views
Calculate the XYZ tile grid given an extent and resolution for a MapGuide server using OpenLayers
I'm trying to add a tiled map from MapGuide to my OL map. However, with my current code, the X and Y values in the request call are incorrect. I have tried specifying the tile grid with resolutions ...
0
votes
0
answers
42
views
Openlayers uses canvas function to return canvas images, How to render in real-time before releasing the mouse button
openlayers uses canvas function to return canvas images, hoping to achieve real-time rendering while dragging the mouse
Only render after releasing the mouse button
How to render in real-time before ...
0
votes
0
answers
47
views
custom event listener in OpenLayers
I created a class that extend Interaction in openlayers. This class allows to select vector tiles features.
/**
* Vector Tile selector class.
*/
export class VectorTileSelect extends Interaction {
...
0
votes
0
answers
33
views
Why React Openlayer cluster doesnt work on dynamic points?
// Init map.
useEffect(() => {
const source = new VectorSource({
wrapX: false,
features: points
});
const clusterSource = new Cluster({
...
0
votes
1
answer
36
views
OpenLayers: WFS response (GML2) is highlighted. But not transformed correctly?
Based on the previous stackoverflow issue. I have a map with polygon displayed highlighted in red with the click on the map. New features are rendered as expected and instead they are landing ...
0
votes
1
answer
41
views
Snapping support for moving polygons in OpenLayers
OpenLayers has an example on how to implement snapping support for points on a map. Though I'm investigating whether snapping is also supported for moving and snapping polygons as a whole, instead of ...
0
votes
1
answer
66
views
OpenLayers: can I get a color which gets by overlaying layers with some opacity?
I have 2 layers with some opacity:
var vectorLayer = new ol.layer.Vector({
source: vectorSource,
style: function (feature) {
return new ol.style.Style({
fill: new ol.style....
-1
votes
1
answer
72
views
Getting coordinates from openlayers map
I have an openlayers map with a vehicle route and it's speed at certain points. To get the speed I need to click on a pin button on the map that opens a pop-up with some info (speed, time, geolocation,...
0
votes
0
answers
25
views
Styling GeoJSON features from a select html give me an error
I continue working on the style classification of GeoJSON features based on the selection in a select html. The function that defines a general style classified by colors works without problem if i ...
0
votes
1
answer
57
views
How to cluster features with matching property with SuperCluster (OpenLayers)
Is it possible to only cluster features with SuperCluster if those features have a matching property or attribute?
For example, I have points on one layer that belong to three different groups, and I ...
0
votes
0
answers
48
views
How to imply the logic of getting a shared canvas in the case of offscreenCanvas rendering?
I have an offscreenCanvas rendering logic like in this OpenLayerrs example:
https://openlayers.org/en/latest/examples/offscreen-canvas.html.
In this example, we use a simple Layer class instance and ...
0
votes
0
answers
37
views
openlayers map.getFeaturesAtPixel returning zero features
I have added a layer group (UTM Projection) and OSM.
Map View projection set to 4326. Trying to get features at clicking position but, not getting the features at map.onclick event. Shall I need to ...
1
vote
1
answer
95
views
Cannot read properties of undefined (reading 'getGeometry')
I've started playing around with OpenLayers, and the first thing I tried was to do one of the out-of-the-box tutorial exercises from the open library. I chose this one: https://openlayers.org/en/...
0
votes
1
answer
63
views
OpenLayers: feature.set() -> feature.changed() doesn't seem to change data
I want my features to change every time I hit checkbox. I've added event listenter to a change. I supposed I would go this statement (as I stated that the 'zero' value is [0]) if (currentValue.length =...
0
votes
0
answers
28
views
OpenLayers how to load image from API, should probably await
I've got my own internal API that I wrote that returns images as a stream/physical file. As I'm new to OpenLayers, I'm wondering how I could setup an image source to hit my own API and put that image ...
0
votes
1
answer
48
views
Geojson Style Openlayers
Following the criterion of styling a geojson by applying filters, I have made this function. It doesn't give an error but it doesn't show the points with the different styles either.
//Style 1
var ...
1
vote
1
answer
37
views
TypeScript & narrowing union types when using built-in methods in OpenLayers 9.1
I get a lot of typescript errors while trying to use methods on types like StyleLike in OpenLayers 9.1. In this example, I create a layer with a single point feature and let it use the default styles:
...
1
vote
1
answer
144
views
How to fix IntersectionObserver causing a memory leak in my OpenLayers web app?
So I'm developing a web application called MSC AniMet. This application is coded using Vue2 and Vuetify2 and it's essentially a big OpenLayers map with a bunch of stuff and functionality added to it ...
0
votes
0
answers
55
views
How to add metadata (exif) to the generated blob from canvas and download it using fileSaver
I have a project in Angular and I generate a map image in canvas using OpenLayers, then I download it locally with the extension .png/.tiff using fileSaver. How can I add metadata to the downloaded ...
1
vote
1
answer
81
views
Create grid perimeter with OpenLayers
Given 2 coordinates and a width, I'm creating the perimeter of a grid in Openlayer with Google map in background.
The distance between the 2 coordinates is 500 meters.
And the width of the grid has to ...
0
votes
1
answer
31
views
Unable to see others layers when using a svg file as background Layer
I'm a beginner with OpenLayer and JS in general.
I create a website with this example : https://openlayers.org/en/latest/examples/svg-layer.html.
I do some modifications to had a vectorLayer as a ...
0
votes
0
answers
30
views
How does one add a sub bar to an interaction control on an ol-ext EditBar?
I would like to add a sub bar to the native 'Point' and 'LineString' interaction controls on an Openlayers ol-ext EditBar. The purpose is to set a subType variable for the parent interactions. The ...
0
votes
0
answers
75
views
Undefined layer in Openlayers 9.1.0
I have a rather large application where I recently upgraded from OL 7.3.0 to 9.1.0. From time to time, i get this error message in the console:
Layer.js:532 Uncaught (in promise)
TypeError: Cannot ...
-1
votes
1
answer
58
views
how to set feature and label zIndex independently
I have a map with a polygon layer below a line layer. However I need the polygon labels to be above the line labels, or have a higher priority in decluttering. The only way that I have found to do ...
0
votes
0
answers
43
views
Distorted PBF Vector Tiles in OpenLayers
I have a local set of PBF files that render parks and roads in a geographic area. The parks display correctly, but the roads are completely distorted at all zoom levels - what could be causing this ...