Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [openlayers]

Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later

-2
votes
0answers
17 views

Display style added to vector layer as legend in OpenLayers 3 [on hold]

I want to display style added to vector layer as legend in Open Layers 3. How can i read and display with symbol
0
votes
0answers
39 views

Creating rectangle on centroid point by map click event ol5

I am trying to develop a web portal using ol5 API where user click on map and then it takes map click event coordinates as centroid of rectangle and create a rectangle of particular height and width. ...
0
votes
1answer
23 views

OpenLayers 5.3 - Managing lots of layers and “sublayers” depending on their attributes values

I'm currently implementing a web map application (OpenLayers 5.3, Tomcat 8/GeoServer 2.14.0, Apache) There is a rising number of vector layers coming from different external WFS services. Using WMS ...
0
votes
1answer
29 views

Create rectangle with center point , height and width ol5 API [duplicate]

I am trying to develop a web portal using ol5 API where user click on map and then it takes map click event coordinates as centroid of rectangle and create a rectangle of particular height and width. ...
0
votes
1answer
56 views

Which is more performant GeoJSON or WMS/WFS using OpenLayers? [on hold]

I'm developing a web application using PostGIS, Laravel, Vue.js and Openlayers, for the moment I generate the GeoJSON from my database using the following code : public function plosWithGeom() { ...
0
votes
0answers
37 views

Why does GeoServer WMS not work in OpenLayers? Problem viewing GeoServer layers

Adding two layers using OpenLayers, one map layer from OSM, second layer adding from GeoServer localhost. But when I load single OSM layer it's showing by default map. It's okay, but when adding ...
-2
votes
0answers
33 views

WFS display problem using GeoServer and OpenLayers

I know a lot of issues have already been posted about this tricky situation, but I can't figure out where is the problem in my script and most of the discussions about OpenLayers are outdated. I'm ...
1
vote
1answer
27 views

On hover show feature information of features inside buffer ol5

I have created a buffer when user enter radius. Points are selected inside buffer but I dont know how to show feature information of selected features. Here is my code: var select = new ol....
1
vote
3answers
4k views

How can I use measure tool with Openlayers 3?

I didn't see any mention for measure tool in OL 3 API. Is there an alternative / a way to use a measure tool (line & area) with OL 3 ?
0
votes
0answers
26 views

Rule based styling in OpenLayers 4

I uploaded some shapefiles to GeoServer and I added them to OpenLayers map using WFS protocol. Now I want to style them by some properties. How can I do this?
0
votes
2answers
500 views

Getting feature coordinates from dynamically loaded layer using OpenLayers?

i want to load the coordinates of a point that is stored inside a vector layer and the vector layer is stored inside a layergroup. I do load the vector layers dynamically to the layergroup "Runs". So ...
0
votes
1answer
50 views

Trouble with openlayers v4.6.5 uploading geoJSON

I have been following a few books but they all seem to be about OpenLayers 3. Things have apparently changed since then. I am having a lot of trouble viewing a geojson over a basemap layer. The ...
1
vote
0answers
36 views

OpenLayers Icon with ngClick

I am working off the OpenLayers Icon Symbolizer example (https://openlayers.org/en/latest/examples/icon.html) to create an equivalent to a Google Maps marker new google.maps.Marker({...}) With ...
1
vote
1answer
33 views

OpenLayers overlay bubbling problem

Regarding on the previous question asked https://gis.stackexchange.com/a/303372/119333, solution from best answer is implemented and its working. I am rendering tab panel inside popup overlay and you ...
1
vote
0answers
34 views

Calculating azimuth of direction in OpenLayers? [closed]

I am developing an application with OpenLayers and I need to calculate the angle between two segments or directions. I thought about getting the azimuth of those segments and then calculate the ...
1
vote
2answers
62 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
1answer
34 views

OpenLayers 4.6.5 - jQuery : map disappears after hide() show() event

This is a little example of what I'm trying to do : https://codepen.io/remifroger/pen/ZZWgbM I would like to build a tabs design, with one map in each tab. I use jQuery to deal with it but I have a ...
0
votes
1answer
42 views

Setting template or drawing layout to print map ol5

I have created a portal which export map and then print. I just wanted to add template or draw layout in canvas for that pdf as shown in the picture below. Here is my code: //print map var dims = { ...
12
votes
3answers
41k views

Change OpenLayers 3 view center

I'm using OpenLayers 3 to interact with some maps. I first declare my map: map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ ...
0
votes
1answer
71 views

OpenLayers 5 ZoomToExtent API

I have a button with class search_ and when clicked i want to change the map view to a specific extent. I am using ZoomToExtend API. Here is what i try, without anything working: var roadlayer = ...
0
votes
0answers
29 views

Select features on OpenLayers and export attributes [on hold]

I am new to OpenLayers and would like to find out if its possible to select features on an OpenLayers web map and export the attributes of the selected features as an ASCII or CSV file?
3
votes
1answer
283 views

Zooming to feature not in center using OpenLayers 3?

inside my webgis application with Ol3 I've to zoom to a single feature. My problem is that I've a panel at the bottom of my screen over the Map div. So the zoomed features often finished half hidden ...
3
votes
1answer
49 views

Access and modify Features

I have some problems for get and set properties in my features. When I try get some property with feature.get('property') It not working. I have to look inside to the object and take the property ...
1
vote
1answer
25 views

Openlayers getExtent() returns wrong values when the dataset crosses the dateline

I have a geojson with some data which I loaded into Openlayers. When I try to get the getExtent of the data source I get awkward values not corresponding to the extent of the data. The following image ...
0
votes
1answer
43 views

OpenLayers refresh vector source with bbox strategy after map moved

I have a vector layer, in GeoJSON with a Vector source on which I applied the BBOX strategy. I have unique IDs for each feature in the layer and having a look at the network tab in the browser the ...
0
votes
1answer
26 views

Use PNG external graphic for vector layer with OpenLayers 5.3

I am currently working on a webmapping project using Mviewer device, linked to OpenLayers 5.3. I am trying to create a new vector layer to locate points, with js. So far, I managed to create a layer ...
0
votes
0answers
14 views

Is there any way to create measure tool (area and length) using Ext JS 6, GeoExt 3 and Openlayers 4?

I am building a web GIS application using Ext JS 6.0, GeoExt 3 and Openlayers 4.3.0. I want to make measure area and measure length buttons so when I activate button I can draw polygon or line and get ...
2
votes
2answers
3k views

ArcGIS93Rest for Openlayers 3

In Openlayers v2 I could get a map from an ESRI server that was not a cached service using code similar to below var arcims = new OpenLayers.Layer.ArcGIS93Rest("MyName", "http://sampleserver1....
1
vote
1answer
3k views

Adding markers using OpenLayers 4

adding markers works fine using OpenLayers 2 but now I need to add markers using OpenLayers 4, how can I do this? my code as follows: var markers = <?php echo json_encode($data)?>; var ...
6
votes
3answers
8k views

How unselect a feature ithat select with OpenLayers-3.8.2's selectInteraction?

I'm using OpenLayers-3.8.2. I want to select a feature and then delete it. my code is as follow: deleteFeature = function(event){ var feature = event.selected[0]; myLayer.getSource()....
1
vote
0answers
17 views

Reusing style and setting feature text label in OpenLayers?

In OpenLayers 5 I have a vector layer which can display 16K features in certain portions of the map. Each feature has a text label that displays a unique name. If I create a new style for each ...
7
votes
1answer
8k views

OpenLayers 3 get current center

Is it possible to get the current position (lat/lng/zoom) in OpenLayers 3 (Like map.getCenter() in Leaflet)? I couldn't find anything in the docs.
0
votes
0answers
9 views

Filtering by area/size on via WFS on GeoServer with OpenLayers [duplicate]

I'm trying to add a filter for area/size of polygons into our OpenLayers v4 implementation which gets polygons from our GeoServer via WFS v2, I've seen the example on GeoServer with area and ...
1
vote
0answers
35 views

Adding marker with specific functions on OpenLayers?

I am new with OpenLayers, my problem seemed easy, but I have troubles with that. I am trying to make some markers when the map loads up, I need 3 of them lets say and also I have some callback from ...
0
votes
1answer
252 views

Fix a 'pixelated' raster WMS

Using GeoServer, I uploaded a netCDF file, got the temperature variable and mounted a color scale through the SLD. This shows me a layer with the style I created. That done, I'm presenting this ...
0
votes
1answer
122 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 ...
2
votes
1answer
56 views

Flip feature Icon

I want any method or help to be able to flip (vertically and/or horizontally) the feature's icon without using the rotation option in the icon style since I am using it already to rotate the icon also....
0
votes
1answer
73 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
1answer
136 views

How to include ArcGIS javascript apis ElevationProfile template in openlayers4 application

I developend a small application using openlayers4 javascript library. As per my bussiness requirement I need to add a elevationprofile widjit to display elevationprofile chart for drawpath. I tried ...
1
vote
1answer
166 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
20 views

setStyle() throws assertion error 41. https://openlayers.org/en/latest/doc/errors

I am trying to set the style of open layer by passing in an object but it is throwing error and when object is passed in an array then it works. Why isn't it letting me pass an object? The code below ...
0
votes
2answers
405 views

OpenLayers 3.15.1 - styleFunction is executed every time I move/change the map

I'm testing the new OpenLayers v3.15.1 and I've a simple question about styleFunction used to plot GeoJSON. My code contains: var vectorSource = new ol.source.Vector({ url: <my geoJson URL>...
2
votes
2answers
1k 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: ...
0
votes
1answer
23 views

Get actual error from ol.source.WMTS.optionsFromCapabilities

I am using the method ol.source.WMTS.optionsFromCapabilities to create a WMTS layer and when I am trying to use a projection that does not exist in OpenLayers it throws an error. Please note that ...
1
vote
1answer
43 views

Openlayers 5: view and save coordinates from drawn feature

I've been following the various examples including this OpenLayers: Get Coordinates of drawn features and this https://openlayers.org/en/master/examples/snap.html and have produced the code below (...
0
votes
1answer
71 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
26 views

Draw a polygon in OpenLayers with coordinates from a variable?

I have the polygon coordinates defined as a variable. This draws nothing when I use the variable, when the same coordinates are used as such in the polygonFeatureT definition, the polygon is drawn ...
0
votes
1answer
23 views

Using OpenLayers with markers on html?

I am having problem showing a marker on page, I have this code which is implemented on my page, in console it is not showing any errors , the map is shown also with this code, but I cant see marker. ...
0
votes
0answers
27 views

Deactivating measurement tool in OpenLayers 5?

I have created a web portal in which measurement tool is available where user select measure distance and area. Now my problem is how to activate and deactivate it when user click on button. here is ...
2
votes
1answer
655 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/...