Questions tagged [openlayers-6]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

Canvas wider than containing div (OpenLayers)

Map canvas is wider than the containing map div. Causes problems when zoom to extent etc. Using Angular Material Flex-Layout / OpenLayers 6. // css .mapContainer { height: 100%; padding: 16px; } ...
1
vote
1answer
13 views

Problems with features on ImageStatic source

I am trying to draw a grid on top of an ImageStatic source in OpenLayers but I am getting extra grid squares on the right side of my image. Why do rows 2 & 3 have 5 columns instead of 4? https://...
1
vote
0answers
20 views

Attribute based styling in openlayers 6 cluster layer

I was looking around for information, but i don't really understant the method. I wouldn't like to add more layers with the same name, because of the layerswitcher. I would like to switch to attribute ...
0
votes
1answer
30 views

OpenLayers 6 layer source parameter refresh problem

I'm trying to refresh a source with some parameter. There is a text input control on the html page, I look forward to updating the map based on user input after clicking the button, but it doesn't ...
0
votes
0answers
20 views

Trying to extend ol.Tile in OpenLayers 6

I am upgrading my app from OpenLayers 4.6.4 to 6.4.3 and I can't access ol.Tile anymore. My code is as follows which works in 4.6.4 (using ol-debug.js). What would I do to achieve the same access to ...
0
votes
2answers
47 views

How to refresh vector tile layer after setting declutter in OpenLayers 6?

I am using OpenLayers version 6. I want to change the declutter of a vector tile layer by using vecTileLayer.set('decluter',false). After changing declutter of layer with the set method of ...
-1
votes
0answers
16 views

Make items in cluster clickable

I have some clustered POIs similar to the earthquake cluster demo (only difference is styling, and that my clusters are set up on click, not on mouse over - i.e. removed the first condition on line ...
1
vote
1answer
50 views

Error in proj4js-Projection while upgrading from OpenLayers 5 to OpenLayers 6 (ETRS:25832 projection)?

I have a map with some layers in Projection EPSG:25832. This works well with OpenLayers 5.3.3. But when I change to OpenLayers 6.4.3 (or all others down to 6.0.1) then there is an error in the ...
0
votes
0answers
23 views

How to add a raster layer in openlayer 6 and its wmts in Mapproxy

I want to add a raster layer to my map. I added a TMS layer map using ol6, now I want to add a raster layer to it. How could I implement it. My TMS layer is generated using Mapproxy & mapnik. My ...
0
votes
0answers
36 views

Is it possible to draw a .pbf from an ArcGIS Feature Server

I'm unable to draw an ArcGIS FeatureServer .pbf result in OpenLayers 6.4.3. The request completes successfully but nothing appears. The layer in question is the NFIS Fire Perimeter Layer. https://...
0
votes
0answers
21 views

Why modified feature resets it's position on zoom in/out in Open Layers 6

I have used select and modify interactions with OpenLayers 6, used feature option for modification. These works fine but face an issue with modify interaction. When I change the position of a feature ...
0
votes
1answer
34 views

Using .pbf Vector Tiles generated with t-rex with OpenLayers errors with “Uncaught Error: Unimplemented type: 7”

I generated .pbf vector tiles with t-rex's generate command. I then uploaded them to a directory served with the Apache HTTP server. Trying to use the tiles with OpenLayers (6.4.3) resulted in no ...
0
votes
1answer
58 views

In OpenLayers 6, remove or rub drawing features like any photo editing application

I am working on application where user can do drawing and change color, stroke, fill and perform undo, redo. One feature is user should have option to rub/remove features like Photoshop or paint. ...
0
votes
1answer
32 views

OpenLayers clear path on marker movement

I'm using OpenLayers 6. I would like to produce behaviour like on Google Maps: When the marker has passed the point, all previous points should be hidden and the only route that is left to pass should ...
1
vote
1answer
28 views

GeoJSON doesn't render on Map in OpenLayers project

I seem to be stuck on a formatting issue of how OpenLayers reads the GeoJSON output I am presenting to it. In my webpage file, I have the following script: <script type="module"> var ...
1
vote
1answer
27 views

How to update my map with the restored features from JSON format?

I'm trying to implement a CRUD that have a map OpenLayers. First, I drawed and saved the features with writeFeatures(). Second, I'm trying to show the polygon that I drawed, and here is my problem: ...
0
votes
0answers
26 views

OpenLayers 6 replace layer image in canvas

I have a single tile WMS layer and at some point I want to change it's image (which was rendered by some WMS service) with an image stored in a server. At a later point I will want to go back to ...
0
votes
0answers
33 views

How to get street view using OpenLayers with Bing map

I am looking into solution for displaying street view using OpenLayers with Bing map. I couldn't find any examples on OpenLayers website. They have examples which displays satellite map using ...
1
vote
0answers
29 views

Vertically fit an Open Layers map in a div

I've created an Open Layers map similar to this example I've mocked up: https://codesandbox.io/s/seamlessly-repeating-vectorlayer-forked-igqti?file=/main.js [EDIT: The above link now shows a commented ...
1
vote
1answer
29 views

Seamlessly Repeating a VectorLayer in OpenLayers

I've created a map in VectorLayers and done a number of things like allow selection, removal of features, adjusting the view, etc. however, one thing that has me stumped is that unlike all the ...
0
votes
0answers
19 views

How to prevent ol.interaction.Modify module's function?

If I use ol.interaction.Modify module with the latest OpenLayers 6, I can easily implement modify function of LineString. But even if the feature of other layers (like marker, etc.) is in front of ...
1
vote
0answers
25 views

How to synch Zoom control and MouseWheelZoom interaction in OpenLayers 6?

In OpenLayers v6.3.1 the map has a Zoom control and MouseWheelZoom is enabled. The map view has 10 resolutions. In OpenLayers v5 prior to v6 using either the Zoom control or the MouseWheelZoom ...
1
vote
1answer
54 views

OpenLayers bbox strategy does not work when zoom in

I am using OpenLayers 6 vector source and bbox loading strategy. this.source = new VectorSource({ format: new EsriJSON(), strategy: bbox, loader: this.loader(layer) }); So, when I open tha app ...
0
votes
0answers
14 views

Use OpenLayers 6 node package with jQuery

I want to use ol node package from nodejs. This package is written in ES6. I am using Asp.net 4.5(aspx) and jQuery to use this. I would like to know how I can support multiple tile layer source with ...
0
votes
1answer
32 views

Serving Tiles of format {z}/{x}/{-y}.png in Openlayers version 6.3.1

I am facing a problem in serving the map tiles in Openlayers the format for the tiles is {z}/{x}/{-y}.png but when i try to add this url into the tile source it is giving me the following error ...
0
votes
0answers
36 views

Getting vertices of geometry that type is not known?

I am using a WFS service that serves Polygon and Multipolygon geometries. But I do not know ehich ones. So I am converting the wfs response to feature. this.http.get(url, { responseType: "text&...
0
votes
0answers
42 views

Vector tile selection layer (canvas) drawn outside the map div. Bug?

I loaded a PBF vector tile layers into my map, and when I select a feature, OpenLayers 6.3.1 creates the selected layer canvas outside the map. Is it a general problem, or just mine? I don't attach ...
0
votes
1answer
55 views

Can't fix this error using OpenLayers v6.3.1 release

I'm very new at using OpenLayers. I really would like to test the consumption of a WFS xml file being returned from a REST call. Using Openlayers v6.3.1 release: https://openlayers.org/download/ I ...
1
vote
1answer
242 views

Import ol-ext to a React - Open Layers 6 project

I'm trying to set up a React project where I want to use some of the tools provided by the ol-ext. I looked around and found some Codesandbox projects from the creator of the library but I was unable ...
1
vote
0answers
36 views

OpenLayers 6 add rulers

I'm trying to add vertical and horizontal rulers on top of my map. In OpenLayers 2 I have seen code that had VerticalRuler and HorizontalRuler as attributes but I can't find something similar in ...
1
vote
1answer
122 views

Detecting self-intersecting polygons in OpenLayers [closed]

I am using OpenLayers Version: 6.3.1. I am allowing users to draw a Polygon in my website. I want to validate the polygon by checking for self intersection. Like This: I referred to Detecting polygon ...
1
vote
1answer
68 views

Adding Street layer to a Satellite map

I am new to openlayers and I am using OpenLayers Version: 6.3.1. I need to display a satellite map. I have used mapbox API to display the satellite map. It doesn't have streets and displays only the ...
0
votes
2answers
110 views

Why ol-layerswitcher latest version can't run in OpenLayers?

I did try load "ol-layerswitcher" in OpenLayers but It didn't work. Furthermore I tried run that through its examples in GitHub but it didn't show anything. Where is my mistake? <!DOCTYPE html> ...
2
votes
1answer
183 views

Static image layer combined with vector layer in OpenLayers 6

I'm trying to have an image layer combined with a vector layer but when I add projection to View the vectors disappear. Am I doing something wrong? Here is an example of what I'm trying to achieve: ...
0
votes
1answer
153 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
0answers
43 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/...
0
votes
0answers
22 views

OpenLayers interaction modify point move

My modify code modify = new ol.interaction.Modify( { source: drawvectorSource, pixelTolerance: 50, } ...
1
vote
0answers
37 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 ...
1
vote
1answer
34 views

How can GeoJson polygons be colored programmatically using OpenLayers 6?

In my GeoJSON file, there is an attribute for each polygon. I am trying to update the fillcolor of the polygon base on the value of an attribute in the GeoJSON file. I have a function getColor() that ...
0
votes
0answers
70 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
37 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
48 views

Displaying a PNG file over a OpenLayers v6 map

I am having difficulty finding a clear solution to this, I may just be over complicating it but I am not sure how to just add a static PNG file over top of a OpenLayers map with a opacity of 0.5. I've ...
1
vote
0answers
31 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
39 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
0answers
84 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
53 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
1answer
57 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
24 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) =...
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 ...