Questions tagged [openlayers]

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

1
vote
1answer
25 views

How to get only Intersected polygon in Open Layers 3

I am trying to draw a line on polygon which I want to split, Example: I want to split 616 polygon as show in image with below code when I tied to get intersected polygon I am getting 616,617,615 ...
0
votes
1answer
34 views

Geoserver and WMS endpoints

I'm trying to access a WMS endpoint through Openlayers to display the data in a slippy map. Here's my code: var basemap = new ol.source.TileWMS( " Layer Name 1", "http://localhost:8080/geoserver/...
0
votes
1answer
36 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 ...
1
vote
2answers
44 views

Using rendercomplete for vector layer in OpenLayers 5

I am interested to add a preloader on the web page, cause i'm loading on the map a 15mb vector, so when all layers are loaded on the map i will hide the preloader. I have found the rendercomplete ...
0
votes
0answers
19 views

OpenLayers: find out the units of height value

Is it possible in OpenLayers to find out (ideally from ol/proj/Projection or from ol/source/Source), what is the Unit of Measurement for height (z-coordinate)? Or is it possible to assure somehow, ...
1
vote
1answer
17 views

OpenLayers using exceed len on vector styles

I have a text inside a style which fits inside a vector polygon. On small polygons the text disappears (map is zoomed in max) so I am trying to set exceed len to true based on this example. How can ...
0
votes
1answer
35 views

canvas.toBlob(function(blob)) is giving SecurityError: The operation is insecure

I'm trying to get the image of Map from OpenLayers 4.6.5 and the following error is appearing each and every time. I'm using cdn link of OpenLayers 4.6.5 for the base Map in JavaScript with Apache ...
1
vote
1answer
23 views

Openlayers 5: zoom view to features in a layer

I'm adding a number of features (linestrings and points) to a layer and I want to zoom/pan the map view to the extent of those features. I thought I'd have to do the following: var map = new ol.Map({...
0
votes
0answers
21 views

Chrome v75.0.3770 render problems OpenLayers v5.3.3 [closed]

After Chrome auto updated to v75.0.3770 today from v74 none of the layers render properly. There are blotches of odd shapes and partially correct map and feature renderings. I even tried a simple ...
0
votes
1answer
27 views

Adding mouse move to my map using OpenLayers

I'm a new JavaScript coder. I'm adding a mouse move to my map using OpenLayers but it's not working to display coordinate in my mouse. 1 - The first step I wrote this code in my js file: map.on('...
0
votes
2answers
63 views

Duplicate labels in ArcGIS Server REST map service OpenLayers 5

I'm trying to export PLSS grid from ArcGIS map server and I have a duplicate labels in PLSS map service. Using OpenLayers 5 My code mapPLSSTownshipLayer = new ol.layer.Tile({ extent: [-...
1
vote
0answers
17 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 ...
0
votes
1answer
55 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 ...
2
votes
2answers
44 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
1answer
33 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:...
1
vote
1answer
25 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 ...
1
vote
2answers
1k views

OpenLayers ol.proj.get returns null after adding projection definition to Proj4

I just stumbled upon the following problem : OpenLayers is unable to retrieve a projection definition even though it has been previously registered with Proj4JS. Code below : import proj4 from '...
0
votes
2answers
40 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....
3
votes
1answer
104 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
59 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
0answers
27 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
34 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
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 ...
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 ...
1
vote
1answer
23 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()...
0
votes
0answers
37 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
2answers
225 views

Import from in Openlayers

I'm looking for some examples in OpenLayers to add in my project, and all those examples had something like this in their JavaScript:` import Map from 'ol/Map.js'; import Overlay from 'ol/...
2
votes
2answers
35 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
35 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
29 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
27 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. ...
5
votes
2answers
11k views

Avoiding CORS error with OpenLayers 3?

The CORS error seen is: Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported All this doesn't work: OpenLayers 3: Cross-Origin ...
0
votes
2answers
98 views

openlayers srs in request

I have a layer in GeoServer and its projection is EPSG:27700. When I query the layer in my app I get and error. Explanation: The GeoServer preview displays it correctly. So I copy the js from the ...
0
votes
1answer
30 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....
7
votes
4answers
22k views

Get single layer in OpenLayers 3

I am doing an upgrade from OpenLayers 2 to Openlayers 3 and it seems to me that in OL3 there is no direct way to get a layer from map by its id. In OL2 it was like: map.getLayer(id) If we look in ...
0
votes
1answer
34 views

Uncaught Type Error p = l.Db(f) Open Layer 4.6.4

I have searched everywhere but I have not found any results. Currently I am trying to load a Vector Tile layer with MVT format hosted by geoserver using OpenLayers 4.6.4. When creating the map, I get ...
0
votes
1answer
24 views

Openlayers 4.6.5 Drawing not populating on map

The code is as follows @Input( 'coreMap' ) coreMap :CoreMapComponent vectorLayer : VectorLayer; modifyLayer : Modify; draw: Draw; vectorSource: VectorSource; style: Style; snap: Snap; ...
0
votes
1answer
46 views

OpenLayers 4.6.5 addLayer circular structure & layer.getLayerArray is not a function

Currently working with OL 4.6.5 and Angular 6 and for the life of me have read the documentation and API references on the OL site http://openlayers.org/en/v4.6.5/doc/ And despite following there ...
0
votes
1answer
133 views

Enlarging extent to include new center

I have a map with some layers, and the layers have different features on them. I have a function that iterates through each layer and creates an extent from all the features' geometry extent. Then I ...
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,...
1
vote
0answers
403 views

WFS-T operations using GeoJSON in OpenLayers

This project https://jsfiddle.net/h7mk0jpt/ performs some tasks such as edit, delete, insert shapes using OpenLayers but while doing these operations, it uses GML object. I couldn't perform these task ...
0
votes
1answer
35 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 ...
0
votes
1answer
34 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
35 views

Drawing a feature on my map

This is my code but it doesn't show anything... var vectorSource = new ol.source.Vector({}); var map = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.OSM() ...
2
votes
0answers
25 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
1answer
32 views

address for openlayer plugin to google maps

In my office, there is a proxy that allows only a few sites to be accessed. My problem is that I need to access through OpenLayers plugin the google maps and I cannot. What could the address be, so ...
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
59 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.
0
votes
1answer
271 views

Function in OpenLayers 5 JavaScript does not work

I am making a weather application and it is essentially working. (It is my first GIS-application, so I am really glad with that!) It is just still very basic. I made de application with PostGIS, NPM ...
3
votes
2answers
1k views

How to filter a vector layer in openlayers?

I'm using openlayers (v3.20.0) in an angular 2 project. I have a vector layer which has its source bound to a geoserver. My task is to filter the features displayed in this layer. I have a ...