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
1answer
85 views

Geoserver HTTP ERROR 500 on layer preview

I have followed the installation instructions on the official Geonode page to install it on ubuntu(18.04.4) and when I finish it I have published a Layer but when I click on Openlayers preview of the ...
1
vote
1answer
54 views

Can show only one icon using style function

I am trying to add two icons to the map and add border to these two icons. However, only one icon gets the border and other icon does not even show up on the map. It is the same with more than two ...
1
vote
1answer
131 views

Display all mapfile layers with Openlayers

I'm using the following code to display my mapfile layers: var wmsSource = new ol.source.ImageWMS({ url: 'http://localhost/cgi-bin/mapserv.exe?MAP=/ms4w/apps/GEO/test.map', ...
1
vote
0answers
54 views

WebSocket connection error with OpenLayers [closed]

I am new to OpenLayers and NodeJS. I have installed OpenLayers on my EC2 instance following exactly the instructions found on the OpenLayers website (https://openlayers.org/en/latest/doc/tutorials/...
6
votes
1answer
991 views

Why Google Maps is not popular with tech stack like Leaflet, OpenLayers, nebula.gl? [closed]

Google Maps is really good when it comes to places data and navigation and still is one of the most popular options for normal uses but whenever I try to look up a GIS tech stack they uses Mapbox, OSM ...
0
votes
1answer
409 views

Problem with mouse zoom in Open Layers 6

I'm using latest version of OpenLayers 6 and I noticed that even in the official examples there is small problem (or it is a feature) with mouse zoom. When I set zoom restrictions then while using the ...
0
votes
0answers
13 views

OpenLayers 5 clusters and cql filters [duplicate]

I try to add clusters on my map with a layer controled by a CQL filter. When I put bbox parameter on my link, it says "bbox and cql_filter both specified but are mutually exclusive". But when I drop ...
1
vote
1answer
48 views

Detecting CTRL key in OpenLayers select interaction?

I have an OpenLayers select interaction with an add condition event handler. const addCondition = (event: MapBrowserEvent):boolean => { return true; } In this handler I need to determine if ...
0
votes
1answer
243 views

Custom bootstrap popover in OpenLayers 5

I try to set different custom for my bootstraps popovers : "popup" and "popup_ancien". I can change CSS of my popovers together, by .popover-content or .popover-title, but how can I have two distinct ...
0
votes
1answer
69 views

GeoServer WMS GetFeatureInfo only returning one Feature?

This is how I get feature info from a group layer when clicking on the map (using WMS GetFeatureInfo): let view = this.map.getView() let viewResolution = view.getResolution(); var source = this....
0
votes
1answer
91 views

Could not locate LayerGroup in catalog GeoServer + OpenLayers?

I have a Layer Group in GeoServer which contains 4 regular layers (layers and group belonging to "TRAC" workspace). I'm trying to do the following on map clicking: featureRequestGS = new WFS()....
0
votes
2answers
83 views

Update WMS layer OpenLayers + Angular?

I have an Angular map app with a WMS layer initialized as following: this.layer = new ImageLayer({ source: new ImageWMS({ url: url, params: {LAYERS: this.getActiveLayers()}, projection: ...
0
votes
1answer
78 views

Filter layers on layer group with OpenLayers and GeoServer?

I have a layer group with multiple layers as following In Angular I created an OpenLayers map adding the group layer like this: this.capaPropia = new ImageLayer({ source: new ImageWMS({ url: ...
1
vote
1answer
82 views

Show Cypriot names for Cyprus on OpenStreetMap map

How can I show only cypriot names (instead of Turkish) in OpenLayers map for the northern Cyprus side? By default OpenStreetMap shows both Turkish and Cypriot. https://www.openstreetmap.org/#map=13/...
1
vote
1answer
43 views

I don't understand the expected specs for GeoJSON data in OpenLayers whether readFeatures() / readFeature() / readGeometry() are used?

I work on a GIS web app using GeoDjango and I struggle reading and displaying a multipoint geometry on my map. If I serialize my GEOSGeometry object to GeoJSON, I can get the following JSON file : { ...
2
votes
0answers
126 views

OpenLayers 6 - reprojected GeoJSON data not displaying on map

I'm using latest OpenLayers (6.1.1) and proj4js 2.6.0 to display a multipoint geometry. I first define my input data project with proj4 then create an open layer vector source as follow: proj4.defs("...
3
votes
0answers
105 views

Multiple color styles in one GeoServer layer

I have a GeoServer layer coming from a shapefile and I am using it with OpenLayers. I want to put multiple colors in the same layer depending on their attributes. How can I put multiple colors on a ...
2
votes
0answers
27 views

Default or wrong behavior with multiple clicks in intersection zone in OpenLayers?

We use Vue.js and OpenLayers 4.6.5 in our project. I've noticed the following behavior - when I have two intersected polygons with some styles and click first time inside the intersection area (look ...
2
votes
0answers
102 views

Using WFS-Transaction to update attribute's value of certain feature?

I want to edit the attribute's value of certain feature. I have managed to display the feature data from GeoServer layer to browser using OpenLayers. I also have managed to display some feature's ...
1
vote
0answers
71 views

OpenLayers 6 TileWMS over server-side proxy script

Let's say I've simple PHP proxy script: $ch = curl_init($_GET['url']); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); ...
2
votes
1answer
130 views

Map Graticule in UTM projections (openlayers)

I'd like to know if there is a way to display the Graticule labels on a different projection like UTM. Visit this link and search for EPSG: "31982" (UTM 22s SIRGAS2000) projection to understand the ...
2
votes
1answer
305 views

OpenLayers declutter styling

declutter does not working as it should be for point geometry, it should avoid overlapping labels and not styling format or geometry. when I set it true for points, points are starting disappear when ...
0
votes
1answer
83 views

Map panning using mouse wheel in OpenLayers 3+ [closed]

How to achieve functionality that user could scroll through map by pressing mouse wheel and dragging map like he can do it by pressing left mouse button?
2
votes
1answer
303 views

Adding border on icons in openlayers

I am trying to add borders to the icons in open layers and I am able to do so but when i try to increase the thickness of the border, the border is not uniform and at one side becomes larger than ...
0
votes
1answer
22 views

How to Update Control When Layers are Changed

I have a control that allows the user to switch between satellite/street tiles. I want the text to update to show the next tile text when appropriate. Currently I am using the Control.render hook but ...
1
vote
2answers
92 views

Openlayers shows and paints polygons in the wrong place on the map

In the following code I call a geoserver service. Initialize map var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source....
1
vote
0answers
41 views

Adding border style to country which has geometry type polygon? [closed]

I have a drop down list and when I select a country name and the map goes to this country, I want to add a specific border style to this country (polygon geometry).
0
votes
1answer
166 views

Zoom level issue with openlayers 5 and custom tile generation using gdal2tiles

Now i have changed my code but the output is still not what is expected, because the resolution provided is of 0 - 8 zoom but my minZoom starts from 12 itself, will i get my tiles rendered ?? how ...
1
vote
1answer
160 views

Error: getGeometry is not a function

I have a GeoJSON file, I can select one of its objects and convert it to a feature object, I need to zoom to this polygon on the map so here is my code: part of JSON object that I convert: { "type":...
1
vote
1answer
95 views

How remove geometry vertexes on hover OpenLayers 3+

I am using modify interaction and would like to be able to delete vertexes by either clicking delete + mouse on the vertex or delete + hover vertex. delete + mouse works, delete + hover does not as ...
2
votes
0answers
45 views

Set HTML ID or class for an icon in OpenLayers [closed]

I wanted to know if there is any way to set an HTML ID for an icon in OpenLayers. For example, If I set an icon with HTML ID "icon1", I want to be able to access it using document.getElementById("...
1
vote
1answer
217 views

Smooth line animation on map

I tried to produce a smooth line animation with below code. How can I do this? I used OpenLayers with Angular. It works as a drawing line but I want more smooth movement something like this (http://...
1
vote
0answers
37 views

Predict the movement of an object on the map considering geodetic calculations in OpenLayers 3?

I need to represent the movement of an object (which has its own speed) but considering the geodedic calculations. I'm working with EPSG:3857 projection. How can I do this?
1
vote
0answers
552 views

Drawing circle of specified radius in meters using OpenLayers 3

I need to present a mask where the user put the radius (in meters) to draw a circle. How can I do this? Do I have to do geodesic calculations to get a circle that follows the projection of the map (...
0
votes
0answers
47 views

Dwithin not working on EPSG:4326

I have a layer in GeoServer called "pois". The layer is in EPSG:4326. Also, I have another layer but it is in: EPSG:31256 The problem that I'm having is that I'm trying to reach an all points around ...
3
votes
0answers
146 views

Canvas element with 'width: 0' in OpenLayers 6 instance on Vue.js

I am using Vue components to generate multiple instances of OpenLayers in the same parent component. Ultimately I am attempting to export an image of each instance of OpenLayers using the html-to-...
1
vote
1answer
54 views

How to build XYZ layer source for custom scales?

I have tile images in scales: 4, 6, 8, 12, 14 (in subdirectories). In smaller scale tiles are in higher zoom (in 14 scale zoom is minimal, in 4 scale zoom is maximal). I have prameters as below for ...
2
votes
0answers
36 views

Tiles map server - How to provide the same tiles on lower zoom?

I have my own map server defined like below. This is one layer, but have 4 layers for other zooms. Unfortunately for zoom lower then 8 I don't have tile images. Is possible to make zoom out lower than ...
0
votes
0answers
24 views

WMTS service is returning incomplete results

Observation: In GWC Demos page reached through the GeoServer admin UI, I am attempting to view a layer group. Some requests are working: https://serverUrl:8443/geoserver/gwc/service/wmts?layer=...
2
votes
0answers
151 views

OpenLayer's graticule doesn't properly work

I am making a map of Krasnoyarskiy krai subject of Russia. I have defined a custom projection that should be used for this area using proj4 string. I need to show lat/long grid only for this territory....
1
vote
0answers
62 views

Show overlay on top when zoom out in OpenLayers 4.6.5?

I have a tile layer, three vector layers. The tile layer has lots of overlays in it. I want to put vector layers on top when zooming out the map using OpenLayers 4.6.5. I tried to apply setLayerIndex ...
3
votes
1answer
105 views

OpenLayers Circle Style Update During zoom

I am using a stylefunction to dynamically draw an 'image' based on the feature geometry. The style function is dependent on the resolution (zoom level) so that the drawn items are a certain consistent ...
2
votes
0answers
142 views

Get Feature id in OpenLayers from GeoServer/PostGIS

With OpenLayers, I'm creating layers like ol.layer.VectorTile var projection_epsg_name = 'EPSG:900913'; var geoserverLayerName = 'teste:map_shape2'; const tileLoadURL= 'http://127.0.0.1:8081/...
1
vote
1answer
64 views

OpenLayers tiles size vs screen size

I'm using OpenLayers v6.1.1 and I would like to ask you to confirm that my understanding is correct. Take a look at below image: Am I right that there might be a situation that if I would take all ...
1
vote
1answer
88 views

How to dynamically rotate image in custom style in OpenLayers

I'm trying to make a custom Style in OpenLayers that replaces a path (Coordinate list) with an image at the end of the path pointing in the direction for the path (like the head of a snake). I am ...
0
votes
2answers
41 views

OpenLayers data format [closed]

I am just running an application using OpenLayers. All data is transfered from my database in GEOJSON format. My current task is to review the implementation of the data format. Important ...
2
votes
1answer
75 views

Getting tile URL in OpenLayers

I'm using Openlayers v6.1.1 and I'm trying to get URLs of all tiles in the current map extent. I was trying to do it in the following way: var tileUrlFunction = tileSource.getTileUrlFunction(), ...
2
votes
1answer
142 views

OpenLayers: Overlay doesn't work

I'm following an OpenLayers tutorial and in my current lesson we wanted to add an overlay to the webmap and when I click on the map it gives me the coordinates of that map. However, for me it doesn't ...
0
votes
0answers
45 views

Get projection or calculate latitude and longitude from a central point [duplicate]

I have a central point (with longitude) and I measure a radius (30º) degrees, I have a distance of 200 KM. Problem: know with precision what is the latitude and longitude of the point that is 200 km ...
1
vote
0answers
35 views

OpenLayers.Format.WMTSCapabilities vs ol.source.WMTS

Struggling with getting a WMTS layer working using OL2. I have it working with OL3 but unfortunately I'm working with legacy code and it needs to work on OL2. Using OL3 (working) var xml = '...'; //...

1
3 4
5
6 7
58