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

0
votes
1answer
21 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
59 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
15 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
50 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
43 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
23 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
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....
3
votes
1answer
94 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
51 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
35 views

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

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
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
30 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
20 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
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
2answers
206 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
31 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
25 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
24 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
96 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
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....
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
45 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
131 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
400 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
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 ...
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
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
24 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
52 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
257 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 ...
0
votes
1answer
50 views

Feature stroke is not updated

I'm changing the stroke color of my features when they are selected like follows: var select = new Select({ condition: click }); select.on('select', function (e) { e.selected.forEach(...
1
vote
1answer
2k views

ol.source.MapQuest is not a constructor

While adding OSM Mapquest satellite map to the openlayers3 i'm getting an error as follow "ol.source.MapQuest is not a constructor". The sample code is as follows <html> <head> <...
2
votes
1answer
29 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({ ...
0
votes
1answer
43 views

Customize behaviour of Ol.interaction.draw.createbox() geometryFunction?

I'd like to enable a draw function in an Openlayers 3 application for drawing a rectangle - up to a certain size (in the defined projected coordinate system, in square meters). For this ol....
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
25 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 ...