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
-1
votes
1answer
8 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 ...
2
votes
1answer
7k views

How do I get all the Layer Vectors added to a Map in OpenLayers 3?

I had a look at this post: How to get all Vector layers from OpenLayers map? The following construct is shown: map.getLayersByClass("OpenLayers.Layer.Vector") Unfortunately getLayersByClass is ...
0
votes
0answers
9 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
15 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
14 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
18 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
1answer
188 views

Including ArcGIS JavaScript api ElevationProfile template in OpenLayers 4 application?

I developend a small application using OpenLayers 4 JavaScript library. As per my bussiness requirement I need to add a elevationprofile widjit to display elevationprofile chart for drawpath. I tried ...
1
vote
2answers
85 views

Need to zoom into a vector Layer of a multipolygon

I am getting a multipolygon coordinates from DB in WKT format. I am able show the same on the map. But the problem I am facing is while zooming to center of the Multipolygon. Is there any way to zoom ...
0
votes
0answers
19 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
35 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 ...
0
votes
1answer
280 views

OL-Cesium - Example doesn't work

I would like to test the Ol-Cesium on my computer with this example: https://openlayers.org/ol-cesium/examples/oldfashioned.html I saved the olcs.css, olcesium.js and Cesium.js file into my webserver'...
1
vote
0answers
14 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
21 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
20 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): ...
2
votes
1answer
190 views

How to move geolocation in OpenLayers 5 programatically

My geolocation in OpenLayers is incorrect by more than 5000 meters. I want to correct this issue, how can I programatically move my geolocation to the most accurate location? Or is it even possible?
0
votes
1answer
94 views

GeoServer get native SRS of layer

I want to get the native SRS/EPSG-Code of a layer deployed in GeoServer. Maybe similar to this solution: https://stackoverflow.com/questions/32766126/get-the-epsg-code-from-openlayers-3-layer but with ...
0
votes
0answers
32 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 ...
0
votes
1answer
172 views

“Zoom to search result” function in qgis2web?

I'm a beginner in GIS and have almost no experience in coding but I'm slowly working my way through everything. Right now I'm trying to make an exported qgis2web map a bit more interesting by setting ...
1
vote
1answer
20 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 ...
1
vote
0answers
17 views

Line and point feature data is not returned by getGetFeatureInfoUrl method after some time

I have web based GIS application with multiple layers. Layers gets rendered as image from GeoServer. Now upon clicking anywhere on the map data of overlapping layers (including line and points) shows ...
2
votes
2answers
2k views

Add a vector GeoJSON layer in OpenLayers 5.1.3

I am trying to add a simple capitals GeoJSON vector layer to my map for basics learning, without managing to get it to work. I spent hours of roaming the documentation API. As follow is my script: ...
1
vote
3answers
41 views

Replace OpenLayers draw form select options by button

I am trying to replace the openlayers draw features form by button. I have created three buttons for point, line and polygon features draw. When clicking the first button (value = point) it works fine ...
1
vote
1answer
208 views

GetFeatureInfo doesn't return anything

I'm attempting to display some properties from the points on my map. I'm using the example provided on the geoserver site: http://openlayers.org/en/latest/examples/getfeatureinfo-image.html?mode=raw. ...
0
votes
0answers
29 views

WFS-T geometry name problem OpenLayers

I am sending my modified features to database with transactional WFS. The problem is when I render my vector features on map their property name which describes geometry is changed to 'geometry' and ...
0
votes
1answer
122 views

qgis2web open file

I am using the qgis2web plugin and everything works fine. I created few point objects in a shapefile layer on the map in QGIS. What I want now is to add the possibility to open a (Excel) file when I ...
2
votes
0answers
24 views

Can declutter work with MultiPoint features?

I have a vector layer with Point data. There could easily be between 10K and 30K features to render, each feature with their respective label, so decluttering is needed. My goal is to have the ...
0
votes
1answer
24 views

OpenLayers Get Column Value Of Currently Selected Feature Having JSON Data Source

I have a service that return data in json format as the following snippet: {"type":"FeatureCollection", "features":[{"type": "Feature", "id": 1, "sheet_no": "NF4011D", "geometry": {"type":"...
0
votes
1answer
106 views

Openlayers with Mapserver

I have setup a map server in my local Windows machine, and can access the map with this link http://localhost/cgi-bin/mapserv.exe?template=openlayers&layers=all&map=C:/ms4w/apps/osm/basemaps1/...
1
vote
1answer
158 views

OpenLayers WMTS reprojection

I have a WMTS service URL, which gives me three layers in projection - WGS84_Pseudo-Mercator (tileMatrixSet). It's very easy to add them using this guide -> https://openlayers.org/en/latest/examples/...
2
votes
1answer
724 views

OpenLayers 3 with GeoWebCache - WMTS vs. WMS

I am using OpenLayers 3 with GeoWebCache (GeoServer). Are there any performance differences between WMS and WMTS when using GeoWebCache? I'm currently using url http://localhost:8080/geoserver/gwc/...
1
vote
0answers
29 views

Show geospatial TIFF as base layer in OpenLayers using GeoServer

I am trying to show a GeoSpatial TIFF file as a base layer in OpenLayers, on which further layers can be imposed. Upon trying to add the TIFF file as GeoTIFF store GeoServer throws below error: ...
1
vote
1answer
17 views

Setting OpenLayers filter with PropertyName?

I'm trying to get a feature with a getFeature request that filters features by their unique id with IsLike. This is the filter on the POST request: <GetFeature xmlns="http://www.opengis.net/wfs" ...
0
votes
0answers
14 views

Making GetFeature return only specified parameters in OpenLayers?

OpenLayers allows to set parameters and filters for getFeature requests with writeGetFeature, which is great, but the returned features contains the full information of the feature. In my case I need ...
1
vote
1answer
4k views

Getting map by id or class using OpenLayers?

How can I get hold of a OpenLayers3 map object associated with a specific id or class (unique)? I searched and found this thread, which says something like: var map = $('.my_map_class').data('...
1
vote
1answer
25 views

WFS request returns FeatureCollection with no feature - OpenLayers

Created the WFS feature request as following: this.map.getViewport().addEventListener("click", (evt) => { //Point transformation to EPSG:25830 var proyeccion = getProjection('EPSG:25830'); ...
1
vote
1answer
29 views

Get WFS feature from click coordinates OpenLayers?

I have an OpenLayers map with a WMS background layer. When clicking the map, I need to draw the WFS feature located on the click. Note that the vector layer is not loaded yet. I must load/request ...
1
vote
1answer
35 views

Get feature by ID in OpenLayers

I have a VectorLayer layer with a feature collection in GeoJSON. The GeoJSON format is as following: { "type": "FeatureCollection", "totalFeatures": "unknown", "features": [ { ...
0
votes
1answer
27 views

OpenLayers map with custom projection not showing WMS

Trying to add to my map an WMS layer with custom projection When executing, the map does not show any layer. Custom projection: proj4.defs("EPSG:25830","+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,...
1
vote
0answers
47 views

qgis2web - show specific layers in layer list

Is there a way to display specific layers in layer list when exporting map with qgis2web plugin? I have created a map with bunch of layers like roads, names of places, rivers etc. but i don't want ...
1
vote
1answer
22 views

SVG does not show up in OpenLayers

I tried adding an SVG as a layer on my map but it does not show up. //For registering EPSG: 2326 import * as proj4x from 'proj4'; var proj4 = (proj4x as any).default; import {register} from 'ol/...
1
vote
1answer
19 views

Getting field from getGetFeatureInfo in OpenLayers?

I'm making a getGetFeatureInfoRequest() as following: this.map.on('singleclick',(evt) => { var viewResolution = /** @type {number} */ (this.map.getView().getResolution()); var url = this.layer....
3
votes
3answers
3k views

Getting different results of fullscreen mode in OpenLayers? [closed]

My original application is not viewing correctly (in all browsers) in fullscreen mode, which is OpenLayers 3 functionality. The problem is with that map does not cover all of my screen and it still ...
1
vote
0answers
38 views

Applying style from QGIS to OpenLayers VectorLayer?

I have a vectorlayer exported from QGIS and added to an openlayers map. I now want to style this layer according to the style I use in QGIS. It consists of numerous line features and they should be ...
1
vote
1answer
370 views

MapServer WFS OpenLayers 4 not visible

I want to add WFS layer from MapServer in an OpenLayers 4.0.1 client. var mapserver_wfs_source = new ol.source.Vector({ format: new ol.format.WFS(), loader: function(extent, resolution, ...
1
vote
1answer
220 views

Android application development by using openstreetmap

Yesterday, I have managed to install my own tile server for One country and we can see the map, its working. The END Goal is, We will build a Vehicle tracking software by using our tiles. Currently ...
1
vote
1answer
22 views

View renders WFS response at a different location

I am querying a feature from WFS using ajax call. Feature from the WFS response is captured but when I am fitting the extent on view so that the queried feature is visible on screen it zoom to ...
0
votes
1answer
17 views

Drag Vertices - ol2 Modify Control vs. ol3+ Modify Interaction

In OpenLayers 2, clicking a geometry with an active modify control running, created a drag vertice on every edge of the geometry which could be used to modify the geometry by dragging. In OpenLayers ...
0
votes
1answer
604 views

VectorLayer Feature setStyle makes features disappear in OpenLayers 4

After I have already displayed my map I want to highlight certain features. For starters I am trying to highlight all features like this: public highlightMapFeatures() { this.map.getLayers()....
1
vote
1answer
285 views

Styling Roads in Openlayers

I am building a style to work with vector tiles. My road geometries are many linestrings in a single layer. I want to style the roads by rendering a casing, fill and centreline from one geometry. ...
1
vote
1answer
17 views

Scale line is not affected by css color of ol-scale-line class

I try to change the color of the text inside the scaleline created with Openlayers via new ol.control.ScaleLine. To change the color I refer to the scaleline in my css sheet the following way: .ol-...