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
0answers
15 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
24 views

Calculating azimuth of direction in OpenLayers? [on hold]

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
1answer
25 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 ...
0
votes
0answers
13 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
11 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
21 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
24 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
0answers
12 views

Get feature information of multiple WMS and WFS layer when user select the layer to fetch information ol5 [on hold]

I have 3 WMS layer and 2 WFS layer. I need to display feature information when user select the desired layer to fetch information. WMS layer code var point_wms = new ol.layer.Image({ title: 'Gound ...
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 ...
0
votes
1answer
36 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
8 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
66 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 = ...
2
votes
1answer
54 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
34 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
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
1answer
22 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
37 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 (...
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
0answers
25 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 ...
0
votes
1answer
22 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. ...
1
vote
1answer
26 views

Layer renders twice with EPSG:5514 in WMTS OpenLayers

I am trying to create a WMTS layer in OpenLayers with the following properties: Url: http://geoportal.cuzk.cz/WMTS_ORTOFOTO/WMTService.aspx Matrix set: jtsk:epsg:5514 Projection: EPSG:5514 I am ...
0
votes
1answer
31 views

How to get individual features from a GeoJson-Multipoint feature using map.on('click'…) in openlayers 4.6.5

I'm trying to get the features of each MultiPoint-point when i click on a point in my openlayers map (4.6.5). The points shows on the map. I want to add a pop-up on each feature when i click on the ...
0
votes
0answers
27 views

Select features on OpenLayers and export attributes

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?
0
votes
1answer
25 views

Find Layer name by click on features in OpenLayers5

I have two vector layers showed but want to differentiate features show for layer1 and layer2. I have this code: var feature = map.forEachFeatureAtPixel(evt.pixel, function(feature, layer) { ...
0
votes
0answers
17 views

Multiple point add in OpenLayers maps with ajax request

I want to display multiple points in the database on the OpenLayers map. Points are in the form of gps coordinates. Here is the code that we have done so far: <?php $con = mysqli_connect("...
1
vote
0answers
42 views

Calculating pixels coordinates from lat/lon

I'm trying to develop a WPS that would print maps to images and PDFs. I don't want to use Mapfish because of its limitations, and because of some customization I need to add to the printed maps. My ...
2
votes
0answers
73 views

Rendering huge vector data whose geometry is fixed but attributes are changing every 2 minutes?

I want to create an application displaying road network with traffic details. I am using OpenLayers 3 and GeoServer 2.14 for this purpose. My data (stored in PostgreSQL+ PostGIS) has around half a ...
1
vote
2answers
48 views

OpenLayers: Keep text style label in visible polygon area

I have a feature with a polygon and a text attribute. The text attribute is displayed via a text-style above the polygons center. Nothing special and so far so good. The current behavior: I can move ...
0
votes
0answers
25 views

highlight all polygons within another polygon ol5

I have 2 WFS layer using openlayer 5 API. I am filtering 1st layer by ID so that one polygon is highlighted now I want to highlight all polygons which comes under the filtered polygon from 1st layer. ...
0
votes
0answers
29 views

OpenLayers: feature.setStyle overwrites style of Select interaction

let's say I have a vector layer created from 2 features. The vector layer has style set to green color. There is a select interaction with a style set to red color (in other words, I want to click on ...
0
votes
0answers
15 views

WMS OpenLayers filter for date

I need to filter the WMS layer included in my map for a date field. Basically I only want to show what has happened after a certain date: I tried the following, but no luck createMap = () => { ...
0
votes
0answers
24 views

OpenLayers Plugin Issue

I get this error when pulling a map from the OpenLayers Plugin. See Below. An error has occurred while executing Python code: AttributeError: 'OpenlayersLayer' object has no attribute '...
1
vote
0answers
43 views

Labeling when using qgis2web

I'm having trouble getting labels to appear in a web map, both Leaflet and OpenLayers, using qgis2web. I can't get either label buffers or backgrounds to show up and even a Bold style only works in ...
0
votes
1answer
33 views

is it possible to show all labels of WMS layer at any extent without SLD ol5?

I am showing WMS layer that shows label on it by defining SLD in GeoServer. The problem is that is is not showing all labels at particular extent. But when I zoom in, all labels are displayed. My ...
1
vote
0answers
34 views

Very slow loading while fetching WMS layer as image/svg ol5

I want to fetch WMS layer as SVG image but it is loading very slow. How to resolve this issue? Here is my code var grid_10hact = new ol.layer.Image({ title: '10 Hactare Grid', source: new ol....
1
vote
1answer
73 views

Difference between ol.proj.getPointResolution() and ol.sphere.getDistance()

Is there anyone who can explain the difference between ol.proj.getPointResolution() and ol.sphere.getDistance()? I have tested it, and ol.sphere.getDistance() is a little bit shorter than ol.proj....
1
vote
1answer
52 views

OpenLayers - LayerSwitcher MattWalker not working with fetch()

I have a problem with Matt Walker's LayerSwitcher on my map construct. I use fetch () to get a WFS. Unfortunately, the LayerSwitcher does not respond to the vector and nothing is displayed in the ...
1
vote
1answer
50 views

Calculate distance from GPX in OpenLayers

I have a little OL script to display GPX Routes in a OSM map. That works so far, even with a little gimmick. What I miss is a continuous distance. So from trkpt 0 to trkpt 1 + (trkpt 1 to trkpt 2) + (...
0
votes
1answer
29 views

Blank screen when using tiled wmts in Geoserver and Openlayers

I am currently following the book GeoServer beginners guide (ISBN: 978-1-78829-737-0). I am on chapter 8 and have been using the following code sample from the book: <!DOCTYPE html> <html>...
0
votes
1answer
13 views

Change specific tile image source in OpenLayers 5

I defined a XYZ source and added to map var source = new ol.source.XYZ({ url: 'http://blabla.com/{x}/{y}/{z}.png', crossOrigin: 'anonymous' }) During runtime I can access specific tile by map....
1
vote
3answers
34 views

Update base layer on toggle button change in OpenLayers

I have an html toggle button and try to toggle update between two layers (baselayer and earthlayer) when it's changed. I am assigning a variable and change the value to the corresponding layer. ...
0
votes
0answers
23 views

Getting OpenLayers pixel value of DEM layer?

I am working in OpenLayers and need to get pixel value of DEM layer to get the altitude of the place. Can you guide me?
0
votes
1answer
36 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 = { ...
0
votes
1answer
33 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 ...
2
votes
1answer
48 views

Snap to crossing between lines in OpenLayers

Is it possible to let the snap interaction snap to the crossing of two different lines (or polygons) in OpenLayers? It can snap to vertices and lines between vertices, but I can't see a way to snap ...
2
votes
1answer
59 views

Is it possible to have an animated SVG as a vector layer feature?

Is it possible to have an animated svg as a vector layer feature? I'm using D3 to make the animation. Here's my animated svg: https://jsfiddle.net/eflowbeach/opfkh0n9/1/ I thought I was onto ...
0
votes
2answers
32 views

Loading WMS in OpenLayers

I am trying to load this https://mrdata.usgs.gov/services/ardf?request=GetCapabilities&service=WMS&version=1.3.0& WMS in OpenLayers3. However, it has two layers (layer within layer e.g. ...
1
vote
0answers
24 views

Organizing large numbers of vector layers with GeoServer

I have a large number (100,000+) of vehicle GPS paths in a PostGIS database. I need access to all of them on my web page, however, I don't usually need to view more than a handful on the map at any ...
2
votes
0answers
48 views

Using OpenLayers with alternative map source to integrate Google Street View?

I am researching any possibilities of Using an alternative map source other than Google that I can integrate Google Street View. Due to the drastic rate changes for Google Maps API I would like to ...
1
vote
1answer
79 views

How to draw a line with OpenLayers by clicking two points?

I've got website with OpenLayers tile layer. I am trying to draw vector line on the map (only one segment between 2 points) on mouse click and to get coordinates of these two points. I read a lot on ...