Questions tagged [openlayers]
Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later
3,594
questions
0
votes
0
answers
42
views
How to read features on the map as the mouse hovers it
As shown in the below posted code, in code in section main, I instantiate an object of type MapFeaturesReaders and then invoke .listen(). when .listen() is invoked, i create new VectorTileLayer. when ...
2
votes
1
answer
41
views
Adding zoom to extent button to layers displayed in ol-ext LayerSwitcher in OpenLayers?
I need a LayerSwitcher with the possibility of including a "zoom to extent" button for each layer. So, searching I found the example:
https://viglino.github.io/ol-ext/examples/control/map....
1
vote
1
answer
59
views
Adding button in LayerSwitcher (Openlayers)?
Got a layerswitcher in OpenLayers (ol-layerswitcher), added to a sidebar.
https://raw.githack.com/walkermatt/ol-layerswitcher/master/examples/sidebar.html
I would like to add buttons, for example, to &...
0
votes
0
answers
35
views
Make mapbox style spec "fill-pattern" image adapt to the current zoom level in OpenLayers? [closed]
Using ol-mapbox-style I'm trying to setup a mapbox style document with a rule for a polygon layer that is meant to have a continuous/seamless fill pattern. According to the mapbox style specification ...
2
votes
2
answers
51
views
Converting Mercator tile coordinate to an OL TileGrid coordinate in OpenLayers?
Is there a method to convert the normal {z}/{x}/{y} endpoints you would get from a tile service into an OpenLayers TileGrid tile?
Here is a mercator tile with coords:
However in OpenLayers the ...
0
votes
0
answers
36
views
GeoServer meta-tile configuration
Can someone point me in the right direction? Somewhat new to GIS / GeoServer. I'm attempting to configure meta-tiling on GeoserverWebCache as described here. We've run into the duplicate label problem ...
0
votes
1
answer
59
views
Prevent sending too many requests while zooming/paning (OpenLayers 6.15)
I have a web page that displays WMS data from a WMS server, using a TileLayer. The images are fetched with a callback function called by the setTileLoadFunction(..) method of the associated TileWMS ...
0
votes
0
answers
41
views
OpenLayers vector layers don't render at certain zoom levels in Chrome browser
Environment:
Chrome browser
Typescript
Angular
OpenLayers 8.0
I have two OpenLayers maps side by side. They need to be synced in all respects except for one layer. So I'm using the same layers and ...
0
votes
0
answers
46
views
OpenLayers Popup not showing. Uncaught TypeError: document.getElementbyId(...) is null being encountered
I am using OpenLayers in React.js to render the results of a GeoJSON data. The results should be shown in a Popup when a marker is clicked. I have been using Microsoft Bing to generate code as I am a ...
0
votes
0
answers
16
views
400: Problem communicating with GeoServer
I have loaded at GeoServer some layers in Mapbox vectortiles. It seems that they show well in the web viewer but there are many errors in the console. If I put the URL in the browser shows "400: ...
1
vote
1
answer
33
views
Encountering Uncaught (in promise) Error: Unsupported GeoJSON type: undefined in React.js using OpenLayers
I am encountering Uncaught (in promise) Error: Unsupported GeoJSON type: undefined. I am rendering it in OpenLayers using a MERN application. I have checked that the API call for the GeoJSON is ...
0
votes
1
answer
14
views
OpenLayers prevent DragPan from bottom of screen
My OpenLayers app runs on iPhones in full-screen. Of course on recent models of iPhone, there is a system gesture of swiping up from the bottom of the screen to suspend the app (eg, to return to the ...
1
vote
1
answer
53
views
autonavi / amap xyz tile layer appears shifted in OpenLayers (Chinese Web Mercator with GCJ-02 datum)
I am trying to add an xyz source tile layer to OpenLayers v8.1.
The source URI for the tiles is the Chinese autonavi / amap provider.
http://webrd0{1-4}.is.autonavi.com/appmaptile?lang=zh_cn&size=...
0
votes
1
answer
52
views
qgis2web: pop up options inside grouped layers
I have a rather complex QGIS project that I wanted to publish using the qgis2web plugin. I aim to maintain the layer tree structure with layers grouped, and I would also like to have pop-ups in my web ...
0
votes
0
answers
63
views
Adapt this code to highlight all returned matches from search field in an OpenLayers map
I have an OpenLayers map documenting nut trees on my farm. I have a search field to search the type of trees. When a single tree is selected in the search dropdown a tree is highlighted. I would like ...
0
votes
0
answers
31
views
A way to get an exact scale from a GeoServer OpenLayers preview
I use the maps to create tiles at certain scales but want to be able to view that particular scale in the OpenLayers preview but GeoServer has its own set scales on the zoom levels such as:
1:67
1:133
...
1
vote
0
answers
33
views
Remove layers from a group and update LayerSwitcher with OpenLayers?
I have a layer group in OpenLayers that initializes empty. This group is added in a layer switcher
var group_search = new ol.layer.Group({
title: 'Search',
fold: 'open',
layers: []
});
map.addLayer(...
1
vote
1
answer
88
views
Using COG images uploaded to Amazon S3 ( private bucket) with credentials in OpenLayers?
I am creating a GIS webApp and trying to show GeoTIFF images as basemap with OpenLayers. This approach works perfectly as long as the corresponding URL is publicly accessible, like this example: https:...
1
vote
1
answer
22
views
Changing closeBox color of ol-ext PoupFeature in OpenLayers
I'm using the PopupFeature from the ol-ext library with Openlayers. Where can I change the color of the popup close button?
var popup = new ol.Overlay.PopupFeature({
popupClass: 'default anim',
...
0
votes
0
answers
36
views
Can't snap to the another feature while translating/move Interaction in OpenLayers
When I try to snap one feature to another feature while translating the feature it was not snapping??
Here is my code :
moveFeatures(): void {
if (this.selectInteraction) {
let ...
1
vote
1
answer
50
views
Line string label text letters overlapping in OpenLayers
I have a Map in OpenLayers 8.1.0 with a VectorLayer, containing a single LineString feature with a Text label. The line is a curve following the Great Circle with 100 vertices.
At certain zoom levels, ...
1
vote
1
answer
64
views
Displaying information about clicked feature in popup in OpenLayers
I'm new to OL. I want to display certain information about a point in a pop-up window. Points are drawn from coordinates:
var pointsStation = [ //координаты остановок
{ id:111, name:'...
0
votes
0
answers
18
views
Deactivate map's 'on' listener in OpenLayers
Is there a way to deactivate simple on listener? I want to create some Points on the map, only if a dialog is opened and do that until user hits the 'Calculate Route' button. Once one of those two ...
0
votes
1
answer
134
views
OpenLayers map rendering issue in Next.js 13 using TailwindCSS on a page with sticky header and footer
I am building a web app using Openlayers in Next.js 13 with TailwindCSS. I am encountering a issue/bug with rendering the base map inside a page with a sticky header and footer. The map has scrollbar ...
1
vote
1
answer
84
views
OLcesium how to load a 3d terrain from mapTile Cloud
I use OpenLayers 6 and ol-cesium 2.15. The basemap in use on a 2d view is the ESRI ocean basemap.
The problem is that, when using cesium, the map shows a white circle in correspondence of each pole (...
0
votes
0
answers
38
views
Create custom layout with OpenLayers
As a side project, I am learning to work with OpenLayers and I am trying to replicate the layout that is shown in these type of maps (see attached image)
I have started to play with the JS following ...
0
votes
0
answers
71
views
Using GeoServer WMS min/max scale in OpenLayers
I have some WMS published from a GeoServer and thanks to the SLD, I defined the min/max scales to bounds my WMS display.
The point is that in OpenLayers, I can't figure out how to use those scales ...
0
votes
0
answers
22
views
"geoserver" publishes "wms", uses "SLD file "and "vec:Heatmap", uses "Tiled" to load, and the picture is misaligned [duplicate]
"geoserver" publishes "wms", uses "SLD file "and "vec:Heatmap", uses "Tiled" to load, and the picture is misaligned.
But using "Single tile"...
0
votes
0
answers
14
views
Displayed entities toggle at each zoom level on OpenLayers map [duplicate]
I have a PostGIS table connected to my GeoServer in which I have published a layer of 80 multipolygon features. The multipolygons have very different sizes and are displayed correctly in the ...
3
votes
2
answers
109
views
Multiply line using style in OpenLayers
I'm working on a map application, where I should display multiple routes, each with its own name and coloring. In some locations, there are multiple routes following the same path.
Is there a way to ...
1
vote
2
answers
124
views
Show/hide feature text depending on zoom in OpenLayers 7
I'm working on a method to show or hide feature labels (text) based on zoom level. I have a working example that uses setScale on the style object of the feature and is triggered by the "moveend&...
0
votes
0
answers
30
views
How to remove interaction from a map
as shown in the below posted code, when digitize() is called, the mouse cursor figure changes inidicating the i can start drawing a polyogn or a geometry on the map.
what i want to do, is when ...
1
vote
1
answer
63
views
Retrying failed XYZ tile load in OpenLayers?
I already had similar question about failed TileWMS retry (Retrying failed TileWMS tile load in OpenLayers), but this time I'm using different approach to solve the problem. Solution is based on the ...
0
votes
1
answer
67
views
Can't call method of OpenLayers object: 'getSource is not a function'
I'm using OpenLayers 7.5.2 to create a simple map with one vector layer having two points. This works. I want to then access the layer object in the map and get to the point features to update their ...
0
votes
1
answer
104
views
OpenLayers can't render the VectorTileLayer
I have a React app that should render a base map and a VectorTileLayer with OpenLayers.
OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers ...
1
vote
0
answers
83
views
Upgrading OpenLayers project to new OpenLayers version
I have a very complex project made with OpenLayers 6.15.1 integrated with the ol-ext library, I would like to switch to the latest version of OpenLayers which is currently 8.0.0
I would like to do ...
0
votes
1
answer
14
views
OpenLayers UTFGrid placeholders not resolved
I am trying to implement an UTFGrid layer on my OL 7.5.2 map, according to this sample: https://openlayers.org/en/latest/examples/utfgrid.html.
However, when creating the layer, the placeholders in ...
1
vote
0
answers
37
views
Getting WMS layer data using OpenLayers
I want to fetch WMS data but not for one feature. I want all the data fetched. I want all the table of attributes of the shapefile itself.
const municipalitiesLocal = new TileLayer({
source: new ...
0
votes
0
answers
63
views
https://vmap0.tiles not working
I am using vmap0.tiles with OpenLayers. Five months ago I could still access https://vmap0.tiles.osgeo.org/wms/vmap0? using https, but for two months it has not worked anymore.
What is wrong?
2
votes
1
answer
129
views
Cutting circle into polygon in OpenLayers?
I have a square polygon and I want to cut circles into it where I click with the mouse. The result should be a new polygon with holes in it.
This is my attempt so far but I can't get it to work.
The ...
1
vote
0
answers
178
views
Drawing arrow only at the start and end of a line string in OpenLayers
I want to draw an arrow only at the end and start of the line string. The arrow should point in the direction of the last / first segment. I have found one way to do this, but it leads to bad ...
2
votes
1
answer
67
views
Events while one loads and when it finishes loading vector layer in OpenLayers v6
There was a code with OpenLayers v5, which showed a "loading" while loading a layer and the same (loading) was removed when the layer is already being shown on the map.
That's because I have ...
0
votes
0
answers
53
views
Difference between TileWMS and WMTS
Map is working fine with TileWMS, but I was wondering is it better to use WMTS to display map as tiles or TileWMS is as good. What are the trade-offs of using either one.
3
votes
1
answer
98
views
Creating dotted line in OpenLayers with outline and fill color for each dot
I want to create a line style with dotted lines, where each dot has an outline color and a different fill color. I know how to make dotted lines, but is it possible to have different colors for the ...
1
vote
0
answers
64
views
OpenLayers PROJ4JS projection of OSM layer is slightly translated?
I am new to OpenLayers and haven't been able to figure out this problem by searching online. I am using a custom projection in OpenLayers 7.4.0 with proj4 2.9.0 as demonstrated in this example. The ...
1
vote
0
answers
30
views
OpenLayers - Event fired when layer is hidden because of zoom level
Is there a specific event when an openlayers layer is hidden because the map view zoom level is moving out of the layer's zoom range (minZoom, maxZoom)? changed:visible is somehow not fired in that ...
1
vote
1
answer
52
views
Break down large vector features into tiles with OpenLayers
I have a large collection of points to render on a map (~50 thousands in this example, and 1 million in another map). Loading them all in memory slows-down the user experience. Therefore, I am trying ...
0
votes
0
answers
75
views
map.getView().fit(vectorLayer.getSource().getExtent(), map.getSize()); is not working
I would like to know how to get all multipolygon features i.e all districts features display on my web map when I select state from dropdown list.
This is the query i wrote to get all districts ...
0
votes
0
answers
160
views
Sidebar and Button - with last version OpenLayers
I have a code with OpenLayers v4 with a sidebar component, according to https://turbo87.github.io/sidebar-v2/examples/ol3.html#home, working correctly.
However, I needed to change to the most current ...
0
votes
0
answers
44
views
Getting color of selected LineString in OpenLayers?
I have a dynamically generated layers of LineStrokes which get their color from the API call. I only have a basic style for them, to which a color is set when I receive data from API and each layer ...