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
1answer
587 views

Openlayers: Update scale from resolution in cached features?

I have a large number of cached vector features which I am caching for speed. However, as they need to change size depending on view resolution, I have to do various updates on them with each ...
0
votes
1answer
77 views

Geoserver HTTP ERROR 500 on layer preview

I have followed the installation instructions on the official Geonode page to install it on ubuntu(18.04.4) and when I finish it I have published a Layer but when I click on Openlayers preview of the ...
0
votes
1answer
23 views

OpenLayers 5 multiple markers all end up at last position

I have a LineString in OL5 and I want to iterate over each segment and display a label at the segment end. I have this mostly working, but all the Overlay labels magically end up at the last position ...
1
vote
1answer
457 views

Order of coordinates for extent property in layer Tile?

I was just going through the documentation for OpenLayers 3.11 and came across Tile(). Now it accepts a lot of properties: opacity, preload , map, etc.), but the one I am interested in is extent. ...
1
vote
0answers
17 views

Determine if a polygon feature is within a projection range in Openlayer 4

This question comes following a previous one that I posted yesterday (link). I have to show on a World Ocean Base map (projected as EPSG:3857) a number of areas. These are contained in a series of ...
0
votes
0answers
21 views

Map generation using MapProxy & Openlayer

I am new to openlayer 5 & mapproxy & I am trying to generate map using MapProxy 1.12 & openlayers5. I am using ubuntu 16.04 & have created virtual environment as in this document https:...
1
vote
2answers
36 views

Convert EPSG:4326 to EPSG:3857 in OpenLayers and React [closed]

Is there a way to convert coordinates from EPSG:4326 to EPSG:3857 in OpenLayers. Or does any one have a method that does this in Javascript?
1
vote
2answers
53 views

Filtering vector tile layer in OpenLayers map? [closed]

I have GeoDjango application for the visualization of household data with around 10k features. So I have used the vector tile for the visualization of these data. Now I faced the problem with the ...
2
votes
1answer
28 views

Applying JSON style from URL to Vector in OpenLayers

Can the style be a URL in OpenLayers? var layer_offline = new ol.layer.VectorTile({ declutter: true, source: new ol.source.VectorTile({ format: new ol.format.MVT(), url: 'http://...
1
vote
1answer
31 views

How to show single GeoJSON file features when changing projection with OpenLayers 4

On my map I load several GeoJSON files containing various polygons (areas). Each layer corresponds to a single file. I also created variable that aggregate sources and layers to enable a search engine ...
2
votes
1answer
32 views

How to deal with overlapping polygons from GeoJSON in OpenLayers 4

I have a series of GeoJSON files (generated by QGIS) loaded on to a map in OpenLayers 4 as different layers. Each file contains multiple polygons. When mouse-clicking each polygon a pop-up window ...
1
vote
2answers
761 views

Get extent on every zoom or pan of map

map.getView().calculateExtent(map.getSize()) I am able to get extent using the above but I want the extent on every zoom/pan of map.. do we have any functions that can do it? i looked at zoom ...
0
votes
1answer
95 views

Publishing web map on website using PostGIS, GeoServer and OpenLayers

I have been trying to create a web map using PostgreSQL/PostGIS - GeoServer - OpenLayers. However, the resulting map is on my localhost and the data published in GeoServer can be accessed solely ...
1
vote
1answer
140 views

Can't add VectorTile in Openlayers 4

I'm trying to add a vector tile layer in my app using Openlayers 4 , but I'm getting the error as follows , ol.js:753 Uncaught TypeError: a.replace is not a function Here is my code to add the vector ...
0
votes
1answer
573 views

Openlayers get boundingbox around circle in cluster layer

I have a cluster layer which contains circles. Each circle contains some number of features. I need to get the smallest bounding box for a circle when it's clicked. If I could get the center and ...
0
votes
0answers
20 views

Why I can see my WMS layer but when I click on layer, OpenLayers WMSGetfeatureInfo is empty?

I added a layer to my map by WMS service, I can see my layer, but when I click on layer It seems it can't return layer attributes (info). This is my code (I did get help from OpenLayers examples): var ...
0
votes
0answers
24 views

Why I can't see my WMS layers in OpenLayers except I've been login to GeoServer with admin user in same browser?

When I refresh my map page and I want see my WMS layers I can't see my WMS layers expect when I'm login to my GeoServer in same browser! no with API, if I don't use crossOrgin in openlayers I'll get ...
0
votes
2answers
59 views

Get attribute table from WMS GeoServer in OpenLayers

I have WMS so I can easily display it in the map, but I want to get the attribute table of the layer from WMS. All solutions I found are about getFeatureInfo which is giving properties when clicking ...
2
votes
3answers
583 views

Need black and white dotted line on Map

Currently I am getting only a white dotted line in my map using the code below: style: new ol.style.Style({ stroke: new ol.style.Stroke({ ...
1
vote
1answer
20 views

Getinfo only returns the first cover inserted

I'm using GetInfo to view the cover information and my problem using this command is: The information displayed is not from the cover seen on the map, but from the first cover inserted in the code. I ...
1
vote
1answer
58 views

Filter geometry based on map extent using OpenLayers

I need to summarize an attribute of a geojson based on the map extent. I want to sum values for all features intersecting bbox. I think that I must use the Bbox filter but isn't clear for me how I can ...
1
vote
1answer
24 views

GeoServer layer property inaccessible from OpenLayers

I have a PostGIS table linked to GeoServer and eventualy with OpenLayers in a web map app. Recently, I have created and populated a new column in the table (called atgid) but it seems that I am unable ...
0
votes
1answer
32 views

Popup filling with AJAX?

Is there a solution to fill a popup with content getting from a AJAX call, without JQuery in OpenLayers 5? The content is in *.txt files, or I can handle it to send the content as a JSON or HTML via ...
0
votes
1answer
110 views

Initialize modify interaction so it can only delete vertices, OpenLayers

I want to initialize modify interaction in the way that the user can only delete vertices. I want to disable the other two functionalities which interaction offers like moving and adding new ones. ...
0
votes
1answer
27 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 (...
0
votes
1answer
24 views

Openlayers: add padding to zoom in on a cluster

I need to add a padding to a zoom in on cluster function. I've used a part of this code to do this. var zoomCluster = function(pixel) { var feature = map.forEachFeatureAtPixel(pixel, function(...
0
votes
0answers
32 views

OpenLayers: given the same number of Features, is it better to have one big Layer or several small ones?

Given a certain amount of features that sometimes don't fit all together inside the current window, is it better to use one single/few big layer/s or it it better to split the features among more ...
0
votes
1answer
160 views

Html2canvas cannot render map in OpenLayers 3

I'm using OL3 and the last version of Html2Canvas (1.0.0-rc.5). When I try to make a PNG screenshot of the div that embed the map it seems that the map itself is blank. Also the feature, that are ...
1
vote
1answer
42 views

Get attribute from multiple WMS sources

I'm using GeoServer and I need to put the value of NDVI from four different wms into a chart. I'm using also OpenLayer for my map. map.on('singleclick', function(evt) { var viewResolution = view....
1
vote
2answers
694 views

Export Map Error from OpenLayers 3 in Chrome?

Im using this js file to export map in Openlayers 3 in Google Chrome but i'm getting en error saying that Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases ...
1
vote
1answer
49 views

Preventing scaling during raster rendering in MapServer

I have encoded some metrics in a 4-band geotiff that will be served by MapServer (v7.4), and I want to "decode" them client-side for display using raster operations in OpenLayers (v6.1). (...
1
vote
0answers
21 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 ...
0
votes
0answers
23 views

How to remove features out of the extent?

I am using openlayers tile strategy and custom load function. this.source = new Vector({ format: new EsriJSON(), strategy: tile(createXYZ({tileSize: 512})), loader: (extent: any, resolution: any,...
1
vote
1answer
38 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 ...
2
votes
2answers
4k views

How to get GetFeatureInfoUrl from multiple layers in OpenLayers 3

I have multiple layers in a map with layer group now onclick I want to get the GetFeatureInfoUrl for the different layers on which I am clicking but the problem is that I am getting only the Info for ...
1
vote
1answer
26 views

Retrying failed TileWMS tile load in OpenLayers

I have a map in OpenLayers with TileWMS source that's not very reliable. At almost every full page load there are a few tiles that fail to load with status 503 - Service Unavailable. When I try to ...
1
vote
3answers
66 views

How to display shapefiles on an OpenLayers web mapping application that are provided by users as an input without making any changes in the database

I have created a web mapping application using OpenLayers 3 which is displaying the data that is stored in a database. Now I want to display additional data that is going to be provided by the users ...
0
votes
1answer
545 views

Allow client to upload ESRI shapefile in OpenLayers 3

I want to build functionality to upload ESRI shapefile and overlay it on map using OpenLayers 3. Once user cross checked I want to save to PostgreSQL/PostGIS table. So far as I Googled I am not ...
1
vote
1answer
41 views

OpenLayers drawing curves

I'm trying to draw a Bezier curve in OpenLayers (geometryFunction2) but there is something wrong with my approach I don't get. The first line seems fine but I can't place the next one. It work's fine ...
3
votes
2answers
40 views

Missing Styles when loading KML file into Openlayers created in Google Earth

I've been trying to display a KML file with Openlayers, which I created with Google Earth. It is a simple polygon with white outline and 50% alpha black filling. In Openlayers it displays as a white, ...
2
votes
2answers
514 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 ...
1
vote
1answer
19 views

Manage WFS service from GeoServer

I'm trying to have a zoom to extents of WFS layer. I'm using this code: var map = new ol.Map({ controls: ol.control.defaults().extend([ new ol.control.FullScreen({className: 'ol-full-screen', ...
1
vote
1answer
185 views

Select Features in qgis2web - openlayers

After using qgis2web to export a map, I am looking to modify the qgis2web.js file to have the possibility to select (highlight) features on click and keep them selected until I click somewhere else (...
1
vote
1answer
935 views

Using OpenLayers 5.3 in TypeScript without Node.js

I would like to use the latest version of OpenLayers (5.3) in small project. The requirements are: no Node.js - I will be running thing on the site hosted on IIS, simple HTML files scripts need to be ...
2
votes
2answers
5k views

Zoom in/out on click in OpenLayers 3?

How to zoom in map in OpenLayerss 3 on click of button? I want to zoom in and zoom out the map on custom buttons instead of + and - buttons which are on default map. I tried with: onclick="map....
0
votes
0answers
26 views

Is it possible to change my Vector Strategy? Open Layers

I added a layer previously on my code, thats it's source scope. const vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), strategy: ol.loadingstrategy.bbox, loader: ()=&...
1
vote
1answer
7k 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 ...
0
votes
1answer
34 views

How do you pull EPSG:4326 tiles from GeopackageJS using OpenLayers 6?

I'm trying to leverage GeopackageJS for use in a mapping application using OpenLayers 6, but the documentation seems to be really iffy-- the link to the API documentation actually 404s and the ...
0
votes
0answers
27 views

WFS features and vector layer

I try do load WFS layer to my openlayers application according to this tutorial enter link description here Features from WFS layer are displaying on the map, but i discover that they are not belong ...
1
vote
1answer
1k views

Openlayers style function not working

I'm trying to make a vector layer factory function of sorts and I'd like the styles to be as flexible as possible so I've followed various examples and arrived at something which should work but it ...

1
2 3 4 5
58