Stack Exchange Network

Stack Exchange network consists of 174 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
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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

1
vote
0answers
19 views

Openlayers 3. OnClick on touch device not triggering perfectly

I have the forEachFeatureAtPixel function and try to trigger an event on click on a point layer with a custom icon. However, the performance on touch devices is really bad. I need to click several ...
0
votes
0answers
25 views

Openlayers v5.1.3. zoom extent [duplicate]

I have searched the forum looking for a recent example where I can zoom to the feature extent of a Geojson layer using Openlayers v5.1.3. I have already created an example below of a Geojson layer, ...
1
vote
3answers
70 views

How to speed up query performance with PostGIS data served up in GeoServer and OpenLayers?

I have published a table with @ 6 million polygons to geoserver, and have built a tool using the OpenLayers filter class to query the data. The performance is abysmally slow, often times not ever ...
0
votes
1answer
26 views

Create a WFS layer with create, query and update function [on hold]

I am relatively new to Openlayers and Geoserver. I would like to create/publish a web feature service layer, to a web map using the QGIS qgis2web openlayers plugin. I would like to know if someone ...
0
votes
0answers
15 views

Easiest way to ensure layer added

My page allows users to turn on and off items in a WFS filter and when none are turned on the lack of filter would therefore allow all results through. At that point I'd like to remove the layer from ...
0
votes
1answer
21 views

Recommended starting point for an OpenLayers v5 (node.js and npm) project

I have a large monolithic OL4 js/php system that I have hacked together in the last year, that has lots of raster and vector functionality driven by json parameter files. I want to refactor/rewrite ...
0
votes
1answer
12 views

Add a vector GeoJSON layer in OpenLayers 5.1.3

I am trying to add a simple capitals GeoJSON vector layer to my map for basics learning, without managing to get it to work. I spent hours of roaming the documentation API. As follow is my script: ...
0
votes
1answer
18 views

Applying Street Labels in OpenLayers 5?

I am trying to replicate https://openlayers.org/en/latest/examples/street-labels.html?q=label plotting highways over California, both from GeoJSON. The Vienna labels show, but my CA highway labels ...
1
vote
0answers
6 views

Setting COLORRANGE for rasters with variable minimum and maximum value in MapServer?

I have a series of rasters picturing the same phenomenon/product eg. the accumulated precipitation and I use the same mapfile for all. Naturally the minimum is always zero but maximum is variable from ...
1
vote
1answer
24 views

How to fit map view to a layer extent in OpenLayers5?

I added a number of markers to the map: const map = new ol.Map({ target: 'map', layers: [ new Layer.Tile({source: new OSM()}), markersVector, ], view: new ol.View({ ...
0
votes
1answer
33 views

How to implement a temperature map using leaflet/openlayers?

I am new on Leaflet/OpenLayers. I have been searching the internet for a way to create a temperature map like the one below, but I didn't succeed...the only thing I made was a classical heatmap, but ...
0
votes
0answers
26 views

How to resize markers in OpenLayers based on zoom?

I am currently working with OpenLayers in an angular component. I am currently using the npm package 'ol 5.1.3' I am trying to get markers to resize based on zoom levels. At a lower zoom level, show ...
0
votes
1answer
11 views

Normalizing or parsing feature info from GeoServer?

I'm building a website to visualize layers from services on an OpenLayers Map. The services come from different geoservers some of them which I don't own. All services are WMS and don't have WFS. I ...
1
vote
0answers
26 views

Points won't display on map using OpenLayers 3 and MapServer

Im constructing a Vector-tile map using data from the following site GeoNorge -N5000. Im constructing it using OpenLayers 3 and MapServer with the data being passed from a PostGis database. I've ...
1
vote
1answer
19 views

Dynamic filter on tile (WMS) layer in OpenLayers

I have a tile later with a WMS source coming from GeoServer. I want to add and change a filter to it when a users changes their selection. I can see some examples for Openlayers 3 and Vector layers ...
0
votes
1answer
15 views

Where is the GeoRSS feature?

I need to show a GeoRSS in OL3 but I can't find the correct way. I want to do this: http://dev.openlayers.org/examples/georss.html
0
votes
1answer
22 views

Openlayers 5: Remove vertex from geometry (polygon)

I could able to remove the recent modified vertex of a feature using removePoint method of modify interaction, as well as using deleteCondition event of modify interaction. However, that is not what I ...
1
vote
1answer
26 views

How can I set Style text from attribute in Openlayers

I have a feature layer in my application. let layer = new OlLayerVector({ source: vectorSource }); So I need to set a style for this layer. But style should write attribute value as ...
0
votes
0answers
20 views

How to implement an opaque heat map in openlayers?

I am trying to implement a heat map like the following in the link(from targomo) using my own data. I just want the opaque effect. I am using ol/layer/Heatmap from openlayers official documentation (...
0
votes
2answers
25 views

Carto UTF Grid in OpenLayers 5

Openlayers doesn't seem to support the URL that Carto prefers for getting UTF Grids. import TileLayer from 'ol/layer/Tile'; import UTFGrid from 'ol/source/UTFGrid'; const newUTFLayer = new TileLayer(...
0
votes
0answers
17 views

Can I stream GeoJSON data in openlayers, using Angular6+

I am using angular 6 and openlayers 5. Angular 6 combined with RxJS can easily create streams. I was thinking to use RxJS streams in order to feed GeoJSON data to ol5 vector layers. Why? Because ...
0
votes
0answers
8 views

Openlayers 2 aand Openlayers 3 Code convertion

I have an old Opanlayers 2 application. And I need to convert an Opanlayers3 code to Opnelayers2, but could not. Opanlaysrs 3 Code var epsg = "EPSG:900913"; var projection = ol.proj.get(epsg); ...
0
votes
0answers
26 views

OpenLayers - avoid Parameter 'width' contains unacceptable value error

I am using ol.source.ImageWMS to insert layers into a web map from this WMS. However, I am receiving Parameter 'width' contains unacceptable value error error if my screen + resolution is too high ...
0
votes
1answer
19 views

Openlayers ArcGIS image vs tile service performance

I want to show my ArcGIS REST MapServer image tiles on my OpenLayers 4 application. But there are two kind of examples to use ArcGIS MapServer. ImageLayer and ImageArcGISRest TileLayer and ...
0
votes
1answer
19 views

How to get layer name from getFeaturesAtPixel in OL4

I'm trying to build a popup that only shows feature info from certain layers. How do I get layer name? I've tried this: const features = this.map.getFeaturesAtPixel(evt.pixel, { layerFilter: ((...
1
vote
0answers
20 views

Reload the dimension values of a layer with OpenLayers 4

I'm looking to reload the dimension values of a layer with OpenLayers 4. My problem is when my App calls the GetCapabilities of the layer, the dimensions received are for a certain datetime, for ...
1
vote
0answers
15 views

openlayers-automatically adding the layers on clicking dynamic checkboxes without actually specifying all the published layers attributes

My tryonly.php looks like following I also have categories.php to add layers with a common category or create a new in the database There is no error in the code below, where i have been using ...
0
votes
0answers
23 views

How to update existing feature attribute using WFS-T and openlayers?

I am trying to update the attributes of existing features in a WFS. When the users clicks on a feature on the map, a popup appears and there is a clickable link in the popup that converts the ...
1
vote
0answers
40 views

obfuscate real coordinates

Due to copyrights I cannot deliver some POIs as plain vector data using GeoJSON in Leaflet or OpenLayers. I'm therefor looking for some kind of sane obfuscation, to make it harder for normal users to ...
0
votes
0answers
23 views

Create a Circle in 4326 projection when I have meters as radius

I need to create a Circle using var circleIcon = new ol.Feature({ geometry: new ol.geom.Circle(center, radius) }); but my map projection is in 4326 proj and my radius are in meters ( from a ...
0
votes
0answers
24 views

How to properly implement EPSG: 27700 using vector tiles in Openlayers 4 and Geoserver

I am trying to get pbf vector tiles which are served by Geoserver to properly render in Openlayers 4 using the code below: <!DOCTYPE html> <html> <head> <title>Vector tiles&...
0
votes
1answer
22 views

Mod_tile alternative for Tomcat?

I have been running a mod_tile + Mapnik + Renderd + PGSQL solution to host local OSM tiles, as described in the switch2osm guides. I recently put a lot of time in recoding my project to a Tomcat based ...
0
votes
1answer
18 views

OpenLayers 4 VectorLayer Feature setStyle makes features disappear

After I have already displayed my map I want to highlight certain features. For starters I am trying to highlight all features like this: public highlightMapFeatures() { this.map.getLayers()....
0
votes
0answers
14 views

How to get DPI to find current scale in OpenLayers?

Is there a way to automatically retrieve the DPI value of an OpenLayers page? The goal is to automatically retrieve the map scale from this code: function mapScale (dpi) { var unit = map....
0
votes
2answers
33 views

Get map legend while using Transformation Functions in SLD style

In my project I have a SLD style which contain Transformation function. The SLD style is looks like this: <PointSymbolizer> <Fill> <CssParameter name="fill"> ...
1
vote
1answer
27 views

What is the dimension used in OpenLayers stroke width?

In OpenLayers, when you are giving a style to layer, say a WFS layer, we can give stroke width, like this: var layerWFS = new ol.layer.Vector({ source: sourceWFS, title: 'plot_layer', ...
0
votes
0answers
7 views

Openlayers - Updating style of overlapped polygons

I made a javascript which reads geojson files, depending on a period selected by the user. These files contain polygons which I display on a map. For now, I've been able to make them transparent in ...
0
votes
0answers
16 views

Set version 2.0 of WFS-T in OpenLayers 4 or 5?

I'm using WFS-T in OpenLayers-5.0.3 according to here. I have created a feature and then sent a WFS request as follows: In below code the program is getting WFS version 1.1.0 only, but I need to get ...
1
vote
0answers
62 views

Openlayers WMTS GET request with Basic Authentication returns 401 Error

We are trying to publish WMTS with basic authentication from Geoserver. Our addwmts() function works without a problem when there is no basic authentication. We have stored our tiles in Geoserver. ...
0
votes
0answers
26 views

How to find features in Openlayers VectorTiles

I use MVT vector tiles with Openlayers and everything works fine - but now I have a conceptual problem. I need to make features selectable and searchable. The problem is that there is no way to ...
1
vote
0answers
39 views

GML/SVG for indoor map in OpenLayers 4?

I am new to GIS world and trying to incorporate OpenLayers with GML or SVG. I am building a map engine and one of the features should be support of indoor maps. It can be accomplished with a static ...
1
vote
0answers
31 views

Feature is undefined when click on map

I try to get feature from map that I add route and marker already but when I click at it. I get nothing from it. Do I miss something? I used typescript(angular 4) this is map declare: ngOnInit() { ...
0
votes
1answer
11 views

Why does setting extent in OpenLayers end up with an adjusted extent?

If I run the following code in OpenLayers 3... console.log(map.getView().calculateExtent(map.getSize())); map.getView().fit(map.getView().calculateExtent(map.getSize()), map.getSize()); console.log(...
1
vote
0answers
18 views

Required version of proj4.js with OpenLayers 4.6.4

I am currently using the version 2.2.2 of proj4.js with OpenLayers 4.6.4 and I plan to move to the version 2.4.3 of proj4.js because it resolves a defect that I have. However, I wanted to know if ...
1
vote
0answers
13 views

ol3 zoom with defined scale

I am trying to show map based on the gridset defined in geoserver, in such a manner that map zooms to that Scale only. Scale is as follow : 1:1000, 1:500, 1:400, 1:300 view = new ol.View({ ...
0
votes
0answers
17 views

OpenLayers doesn't load map after setting new view by AJAX

I added an WMS Tile layer (a table in PostgreSQL which is loaded and styled in GeoServer). I'm trying to develop a function that zooms to the feature which is determined by clicking the feature's name ...
1
vote
3answers
61 views

Creating a source and a layer from vector tile features in Openlayers

So I retrieve all my features from a vectorTile layer (PBF from Geoserver), and now I want to recreate a layer by filtering on those features and getting only those that satisfy a request. I ...
0
votes
0answers
39 views

Painting order in OpenLayers 4+ WebGL

There are a lot of features in the vector layer. I want to highlight one of them. The feature's style is changing but many others too! Why is this happening? Moreover, some features hide when I ...
-2
votes
0answers
23 views

Bootstrap 4 (B4) accordion does not work inside OpenLayers 4 (OL4) Overlay because of stopEvent=true

I'm working on a website using OL4 for rendering the maps. Just today I tried appending a B4 accordion inside an ol.Overlay (inside an ajax's .done()) and it didn't work, as in it did not collapse/...
2
votes
1answer
41 views

OpenLayers 3 street data

I am able to manipulate coordinates, their position and diverse data. when testing I can see the street name on the map but i can't seem to find the data property to get. What i am trying to do is ...