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
0answers
47 views

Offine storage titles with Openlayers

I'm developing an app with turn-by-turn navigation and I use OpenLayers consuming a tile server. However, I need to cache all the tiles of the route to be able to navigate offline. Is there a way to ...
0
votes
1answer
121 views

GetLegendGraphic and getLegendUrl function filter by extent

I tried to get a legend image from my GeoServer Instance filtered by extent (render only symbologies that are currently displayed on screen). For this purpose I used the getLegendUrl function from ...
0
votes
1answer
111 views

OpenLayers 6: add padding on fit function

I'm trying to apply the padding on fit function but is seems that there aren't effect. This is my code: var sourceGeoBlog = new ol.source.Vector({ url: '{% url 'api_geopost' %}', format: new ol....
1
vote
0answers
170 views

OpenLayers React export map and vector layers

For my project I am trying to export the map I have created with all it's Vector layers. I can't seem to get the example I found on the site of OpenLayers to work in React. The export doesn't need to ...
0
votes
0answers
25 views

LineString Heatmap with Open Layers 3

I need to make a heatmap with a bunch of linestrings using AngularJS and Open Layers 3. I didn't find any examples, just a question answered here but that don't worked for me. In the question he do a ...
0
votes
0answers
39 views

OpenLayers 6 : Display radius while drawing

I tried to draw a Circle in OpenLayers 6+. It works perfectly but I would like to display the radius line as it was displayed in OpenLayers 3 (see the bellow example): http://tsauerwein.github.io/...
1
vote
1answer
56 views

OpenLayers 6: blur effect with ImageStatic

I'm using a static image on my map in a project with Django. The code is inspired to the official example: var imageSourceExtent = [ 12.1986543459999996, 44.9052984770000023, 12....
1
vote
1answer
66 views

OpenLayers getGetFeatureInfoUrl with dragBox in CQL

I tried to request Geoserver (2.16) WMS with the function getGetFeatureInfoUrl (From openlayers 6+) I tried this by passing the dragBox extent as a CQL filter. dragBox.on("boxend", () => { ...
2
votes
1answer
80 views

OpenLayers displaying Polygon with Icon style

I was working on a React project with an OpenLayers map and I was having problems with showing Polygons on the map. When the map is too zoomed out, the Polygons would be to small to see them. So then ...
0
votes
0answers
41 views

How to set interval option for timeslider with same min and maxdate using Ol-ext:Timeline control?

I am trying to create a timeslider with Ol-extension timeline similiar to https://viglino.github.io/ol-ext/examples/storymap/map.control.timequake.html. All the sample codes have different min and ...
0
votes
0answers
44 views

Uncaught TypeError: ol.control.Timeline is not a constructor

I have been trying to create a timeline in my openlayers map. However it shows that it is not a constructor. How to fix this? this is my code var tline = new ol.control.Timeline({ className: 'ol-...
1
vote
2answers
91 views

Vector layer from MapServer WFS not displaying in OpenLayers 6

I want to display a WFS layer in GeoJSON format on my map via OpenLayers. All my layers in WMS appear, only the one in WFS does not appear. I did create a "WEB" block in the mapfile. And my layers are ...
1
vote
1answer
36 views

OpenLayers: Incorrect rendering of WKT

I'm using the draw function of OpenLayers for draw a polygon. I need the wkt from the drawn geometry because I need to send it to PostGIS. <textarea name="name" rows="20" cols="80" ...
0
votes
0answers
26 views

Reading features from GML OL3

I am trying to read features with ol.format.GML (using OL3). As a result I get feature but not it's geometry. GML file looks like this: var gmlString = '<?xml version="1.0" encoding="utf-8" ?> &...
0
votes
0answers
38 views

OpenLayer Impossible to load GML file with ESPG:3947

I try to load my gml file with this code but it doesn't work. Did I forgot something ? import Map from 'ol/Map' import Layer_Tile from 'ol/layer/Tile' import source_OSM from 'ol/source/OSM' import ...
0
votes
1answer
143 views

Executing task npm run test in Visual Code Studio stopped working

I was working normaly in Visual Code Studio and everything was ok, then stopped uploading my changes from js in localhost server page.With npm start and build:server is running and built. But npm run ...
1
vote
0answers
36 views

Experience with issues faced while upgrading from OpenLayers 4 to 6

We are thinking of migrating from OL 4 to 6, skipping 5. I read the upgrade notes, but I wanted to know if someone here also jumped from v4 to v6 and their experience if they faced any major hurdles ...
0
votes
0answers
39 views

Impossible to display my GML file

I would like to display my GML file but I don't understand why nothing appear in the map: code: import Map from 'ol/Map' import Layer_Tile from 'ol/layer/Tile' import source_OSM from 'ol/source/...
0
votes
0answers
18 views

OpenLayers6 TileArcGISRest LAYERS param doesn't allow to modify and transparency of the features

I am trying to modify the transparency of the features ans I don't have a clue about how to do it. The site https://openlayers.org/en/latest/apidoc/module-ol_source_TileArcGISRest.html refers to ...
0
votes
0answers
20 views

How to set the styling(symbology) of feature layer as defined in the service?

While adding a feature layer(points) to my openlayers map, the styling of the points seems different from the actual symbol defined in the drawing Info of the service. How to set the styling as ...
0
votes
0answers
37 views

OpenLayers get layer group visibility status on change event

I'm new in using OpenLayers map and I'm trying to build a map that will show some layer information. I built my layer group as follows. new LayerGroup({ title: '', fold: 'open', ...
0
votes
0answers
59 views

How to trigger map event in OpenLayers?

In OpenLayers v5.3.0 I would like to call a function once map have finished rendering all layers. I only know how to register a function for said event lisener, but don't know how to trigger it. I do ...
0
votes
1answer
31 views

Zoom to polygon's extent in OpenLayers

I've an array of coordinates that represent a polygon, inspired from this official example I've modified "Fly to Bern" for my aims. <button id="testID">Test</button> <script type="text/...
0
votes
0answers
98 views

Printing OpenLayers map with vector tile layers has CORS error for GeoServer vector tiles

I want to create a client side printing module for OpenLayers (v6) map. In OpenLayers web site there is a printing example with JSPDF (Export PDF example ). I used this example but there is an error: ...
1
vote
1answer
46 views

OpenLayers style doesn't work on certain GeoServer WFS layer

I want to change styling of the GeoServer WFS layer using OpenLayers. The problem is, there is a layer that the style can be changed, but there are other layers that can't be changed. Using this code ...
1
vote
0answers
29 views

How to change Openlayers MousePosition control as mouse up?

I am using openlayers 6.x and Mouse position control. this.control = new MousePosition({ coordinateFormat: createStringXY(this.precision), className: this.className || "mouse-position", target: ...
0
votes
0answers
38 views

Migration from OS OpenSpace API to OpenLayers 6.3 - Cannot get icons to show

So I've setup a fixed point to render, co-ordinates are translated from LonLat to GB OS coordinates. Code generates no errors but also doesn't render the icon. Icon path has been checked and is ...
1
vote
1answer
40 views

Differentiate style used to render vertices of lines and polygons from style used to render plain point features?

Context I'm using OpenLayers 6 to let a user make some (multiple geometries) drawings (i.e. vector features) on map. I build a function to render the different geometries. I also wanted to display the ...
0
votes
1answer
64 views

GetFeature WFS request with Spatial Filter throws an error

I'm using the following request in order to get the closest feature from a layer given some specific coordinates: http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_PPHH_2012/wfs?&VERSION=...
0
votes
0answers
57 views

Using OpenStreetMap Transport layer as xyz in OpenLayers

How can I use Openstreet Transport layer as baselayer in Openlayers? var transport_layer = new ol.layer.Tile({ source: new ol.source.XYZ({ attributions: '', url : 'https://a.tile....
0
votes
1answer
41 views

Converting Long Lat from Address in OpenLayers

I want to convert Long Lat from Address using OpenLayers. For example: Address: London => Lat: 51.507351 , Long: 0.127758 I can't document tutorial.
0
votes
0answers
65 views

Add GeoServer WMS layer on web page using OpenLayers

I am trying to add GeoServer WMS Layer using OpenLayers on the web page. And here is my code: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WMSLayer.aspx.cs" Inherits="OpenLayerMap....
1
vote
1answer
47 views

How to get the co-ordinates of the clicked point using 'ol/Draw' in OpenLayers 6?

I am trying to create a measure tool using OpenLayers 6. I did get examples to measure distance and area using the ol/Interaction/Draw and ol/geom library classes. I want also to measure the ...
0
votes
0answers
19 views

Apply style to feature after adding it to layer Source

I am trying to apply style of my newly created feature which I add programatically to already defined vectorSource. scope.tempSource = new ol.source.Vector({wrapX:false}); scope.drawingVectorLayer = ...
1
vote
1answer
27 views

Show popup only with a specific zoom level

On my map I've a point vector that is showed as heatmap down to one a specific zoom level, after this I show the points normally. var geoBlogHeatmap = new ol.layer.Heatmap({ title: 'Heatmap', ...
0
votes
1answer
45 views

Openlayers with multiple TileLayers with WMTS source, second layer shifted

I'm trying to create map widget with multiple layers. Base layer is OSM base map. Upon that I add two more layers with different CRS. Layer A is added with EPSG:3912. Layer B is added with EPSG:3857 (...
1
vote
1answer
23 views

How to unset an event listener in OpenLayers 6?

I am trying to use '.un' to unset the 'single-click' event listener. I have tried all the ways available. How can I do this? measurePoint() { const that = this; this.mapObj.on('singleclick', (e) =...
0
votes
0answers
38 views

OpenLayers TextStyle background fill only uses one color at a time when rendering

For my vector tile layer, I have several Point geometry features with text. I'm setting the text style's background fill property for these features to different colors based on the text: if(label ===...
0
votes
1answer
51 views

How to add graphics to map centre in OpenLayers?

I am using the following code to add point graphics to the map center whenever there is an extent change, how ever the point remains at [0,0] and doesnt change with change in extent. How can I fix ...
0
votes
0answers
22 views

Inconsistent zoom levels for OpenLayers image and vector map layers

My OpenLayers map has 2 seperate layers, a TileLayer with a custom XYZ source and a VectorTileLayer with a custom VectorTile source: var tileSource = new ThemedTileLayerSource({ url: this.props.url + ...
1
vote
1answer
48 views

Use Google Direction API result to display route in OpenLayers

I need to show route between 2 points in OpenLayers. I have received the route details from Google Directions API. The API has given start location / end location, Steps and overlay_polyline (encoded) ...
3
votes
1answer
62 views

How to center the text of a vector point feature in OpenLayers

I have several point features displayed in OpenLayers that, when a background fill is applied and small to no padding is set, don't center their text values in the center of the block fill: This same ...
1
vote
1answer
133 views

WMS GetFeatureInfo request with buffer doesn't return any result (OpenLayers/MapServer)

I'm using OpenLayers 4 to build a GetFeatureInfo URL with a buffer parameter to a WMS layer in MapServer in order to find the closest feature of the layer given some specific coordinates. The problem ...
1
vote
0answers
20 views

Blured tiles while loading map

It might be a stupid question but I need to ask it. On the latest version of OpenLayers which is using OSM tiles, when you are quickly zooming map the tiles which are not loaded yet gets blurry: On ...
1
vote
1answer
64 views

OpenLayers: Draw feature of defined size (in meters)

I'm trying to draw a rectangle polygon on the map having a defined size in meters. Background is: I want to show the user a rectangle of a defined paper size (e.g. DIN A4) on the map to choose a ...
0
votes
0answers
55 views

Openlayers 6 geometry editing not smooth in mobile

I am working on an ionic application and implementing geometry drawing using OpenLayers 6 the problem is that when I try modify the the geometry, it is working well in browser but it hangs in mobile. ...
1
vote
1answer
68 views

Proj4 projection supports WebGLPointsLayer but throws GeoJSON polygons off

In order for the following WebGLPointsLayer this.layer = new WebGLPointsLayer({ source: new VectorSource({ url: "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month....
1
vote
1answer
106 views

Loading GeoJSON in OpenLayers?

I am trying to load GeoJSON in OpenLayers, however, the polygon isn't visible on the map. What am I doing wrong? <!doctype html> <html lang="en"> <head> <link rel="...
0
votes
1answer
88 views

GeoJSON layer fails to load

I'm downloaded OpenLayers v6.3.1 libraries and successfully displayed a simple map on my local server, and nom I'm trying to load a GeoJSON file as a new vector layer into this map. But for some ...
0
votes
2answers
92 views

CORS problem when trying to call WMS getFeatureInfoUrl using OpenLayers [duplicate]

I'm using the newest stable version of OpenLayers which is 6.3.1. I have a problem when trying to call http request on an url genereted by the wmsSource.getFeatureInfoUrl function. It returns me an ...

1 2
3
4 5
58