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

1
vote
1answer
21 views

How to avoid start/end points of line modification with ol.interaction.Modify

To modify line geometry on OpenLayers(3-5), we use ol.interaction.Modify. What I want to do is, enable modify any points on line, except start / end points. But just using ol.interaction.Modify ...
0
votes
2answers
36 views

ArcGIS REST layer doesn't show up in OpenLayers

I try to show a WMS layer with OpenLayers 4.6.5 but the tiles don't show up. I use the following code to load the WMS layer as ArcGIS REST service: new ol.layer.Tile({ source: new ol.source....
0
votes
0answers
23 views

Map component .getWidth() is not a function (GeoExt3, MapFish, OpenLayers 4)

I'm trying to work through the tutorial here*. But I'm discovering something unexpected in terms of my map component. The app code here. My layers, maps, and map component are created (successfully) ...
1
vote
0answers
28 views

Not able to display KML file - OpenLayers

I tried to load my KML file from one of the OpenLayers examples import Map from 'ol/Map.js'; import View from 'ol/View.js'; import KML from 'ol/format/KML.js'; import {Tile as TileLayer, Vector as ...
1
vote
0answers
21 views

Transformation issue while SVG to GeoJSON conversion

I have a vector image in SVG format. (without georeferences) I am trying to display it using OpenLayers to display properties of different polygons in it. I tried converting it to GeoJSON but the ...
0
votes
1answer
48 views

Create layer based on input parameters and zoom in OpenLayers 5

I have a vector layer which i statically load all the features from the JSON file. What I want to do is to create layers dynamically based on the user input. The user will choose district code, for ...
0
votes
0answers
35 views

Converting and serving NOAA nautical charts to leaflet/openlayers application [on hold]

I’m starting a new personal project in which I pretend to load sailing tracks on a nautical chart. I’m absolutely new to GIS and after researching a bit have become overwhelmed by the amount of ...
0
votes
1answer
31 views

OpenLayers, problem with WFS service and “outputFormat”

I have a service and I tried to paint his layer on my map: http://www.ign.es/wfs-inspire/unidades-administrativas?REQUEST=GetFeature&SERVICE=WFS&VERSION=2.0.0&COUNT=1&srsName=EPSG:...
0
votes
0answers
35 views

SVG to GeoJSON conversion - incorrect render

I have a vector image in SVG format.(without georeferences) I am trying to display it using OpenLayers to display properties of different polygons in it. I tried converting it to GeoJSON but the ...
1
vote
0answers
13 views

Using olms to style self hosted mbtiles from openmaptiles not working

I've downloaded a OpenStreetMap vector tiles (.mbtiles) file from openmaptiles.com and successfully hosted them using node.js with the mbtiles and express node modules. I want to use a style gotten ...
2
votes
2answers
30 views

Setting Labels on Vector features in OpenLayers 5

I am following this very big example to set labels on the style of the vector but it's confusing. The labels should be the Plot numbers, of each feature, which come from the JSON file. Also i have ...
0
votes
0answers
31 views

Getting attribute info from OpenLayers (QGIS2Web)

The below files are generated from QGIS2Web tool and altered by me, I generated the OpenLayers code using QGIS2Web. The problem is not showing the pop-up(attribute information) for multiple Layer ...
1
vote
1answer
23 views

OpenLayers 5: add Interaction and style selected feature

based on this example addInteraction adds opacity, so I am setting a new style for each selected feature, however the clicked features remain red. I only want to style with the red border only one ...
1
vote
1answer
19 views

Store geometry change on modify interaction OpenLayers

I am using OpenLayers modify interaction with events modifystart and modifyend. I am trying to remember state of feature before it is modified. I do it this way: var modificirane_cestice=new Object()...
1
vote
1answer
23 views

Styling OpenLayers 5 Vector dynamically

I have a checkbox button, and I am trying to change the variable getStyle dynamically, when jQuery change event is triggered. Though style property doesn't get updated when the event is triggered. ...
0
votes
1answer
28 views

Map exported to PDF background color is black ol5

When I am exporting map to PDF, it is all looking black in backgroud. Here is my code map.once('rendercomplete', function(event) { $('.filter').css('display','none'); var canvas = event....
0
votes
0answers
23 views

Cursor not centered on feature - OpenLayers

Can anyone tell me why the cursor is not centered on the feature? This can be seen in the Overlay event of the map and even in the onClick event. We can only click on the element in a certain position,...
0
votes
1answer
30 views

ol.inherits in OpenLayers 6

I'm testing OpenLayers 6 beta. ol.inherits looks missing in OpenLayers 6. ol.inherits(ol.source.NowMap, ol.source.OSM); This causes error Uncaught TypeError: ol.inherits is not a function What ...
0
votes
1answer
34 views

Modify polygon in OpenLayers

Here is the next function to select and modify the selected polygons. I have an error in var "vectorLayer = new ol.layer.Vector": missing: after property id. that someone are correcting my code and ...
2
votes
0answers
23 views

Displaying GeoServer vector tile using OpenLayers?

I'm using OpenLayers 5.3 and GeoServer to create a web map. Previously, I was using Leaflet and was able to display my layer as a vector tile. Now, I'm having issues getting the vector tile to display ...
0
votes
0answers
18 views

OpenLayers drag event slow to respond (hard to move)

We have an application that loads data from the postgis and draws on the map in layers of vectors. When many elements are loaded, does the map get heavy to use the drag event, slow to respond to user ...
-2
votes
0answers
51 views

Windy API for OpenLayers 5

Is it possible to use Windy API for OpenLayers 5? There was an answer 3 years ago.. Maybe sth has changed.
2
votes
1answer
26 views

get only property name and value from getGetFeatureInfoUrl WMS layer ol5

Stuck in a problem to get only property name and value of WMS layer. here is my code var point_wms = new ol.layer.Image({ title: 'Gound Control Point', source: new ol.source.ImageWMS({ ...
1
vote
0answers
37 views

Show/Hide labels of Vector Tile layers on button click

I have displayed vector tiles layers with "application/vnd.mapbox-vector-tile" format in Open Layers 3.While creating vector tile I have applied only image style. I want to display labels for existing ...
1
vote
0answers
41 views

Getting distance between route and points around that route?

I have a route between 2 points by means of OSM routing service. I want to get the distance between route and points around. How can I achieve this? I created this route by the following example ...
0
votes
1answer
38 views

Add loading image until filtered layer is shown ol5

I am developing a portal in which I have created a rectangle buffer and the polygon within buffer is selected. Here is my code to filter layer var polyStyle = new ol.style.Style({ stroke: new ...
1
vote
1answer
21 views

Create Polyline from Coordinates Array in OL OpenLayers 5.3.2

I'm using OpenLayers 5.3.2, and would like to create my own marker animation using almost exactly the example at https://openlayers.org/en/latest/examples/feature-move-animation.html?q=marker All I'd ...
0
votes
1answer
32 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
34 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
0answers
42 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
64 views

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

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
40 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
1answer
41 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 ...
0
votes
0answers
28 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?
1
vote
0answers
53 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
0answers
45 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 ...
2
votes
2answers
41 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
1answer
45 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....
0
votes
0answers
23 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 ...
0
votes
1answer
39 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 ...
1
vote
1answer
28 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 ...
1
vote
0answers
23 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 ...
0
votes
1answer
57 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
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 ...
0
votes
1answer
104 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 = ...
3
votes
1answer
92 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....
1
vote
0answers
38 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
0answers
25 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
1answer
24 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
72 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 (...