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
1
vote
1answer
1k 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 ...
1
vote
0answers
17 views

Why TreeView Kendo is not executed properly?

I made a tree view kendo to enable the user to turn off or turn on the two layers "osmlayer" and "bing_road". but the treeview is just shown and does not work. first of all chrome debugger showed that ...
0
votes
0answers
40 views

Requested JSON parse failed while getGetFeatureInfoUrl

I am trying to get the feature attributes from WMS service published in GeoServer and showing the attributes as a popup in the .NET application. When I make an Ajax call it gives "requested JSON ...
3
votes
0answers
32 views

Displaying QGIS's “Map Tips” in OpenLayers?

Still a little new to QGIS and Openlayers. How would you display QGIS's "Map Tips" into OpenLayers? I am currently using QGIS 2.18 and have the latest update in Openlayers. In QGIS, I have created a ...
0
votes
1answer
32 views

Why is getGetFeatureInfoUrl failing?

Running getGetFeatureInfoUrl() against a TileWms source returns: Either no layer was queryable, or no layers were specified using QUERY_LAYERS My URL is https://geoserver.xxx.com/geoserver/yyy/wms?...
0
votes
1answer
17 views

Using Mapbox vector tiles from Geoserver in OpenLayers?

Currently this error code is the only result: mvt.e31bb0bc.js:116 Uncaught AssertionError code: 43 message: "Assertion failed. See https://openlayers.org/en/v5.3.3/doc/errors/#43 for details." name: ...
0
votes
2answers
2k views

openlayers 4: force refresh tiles in ol.source.VectorTile on interval

I'm using openlayers 4, and have a ol.source.VectorTile which uses MVT tiles. I want to refresh the tiles every 5 seconds without refreshing the browser. I've used source.changed(), source.refresh(), ...
2
votes
1answer
18 views

Appending linear ring to multipolygons in OpenLayers

I am trying to append linear ring to multipolygon. When I try to do same for polygon it works. case 'Polygon': linearRing=new ol.geom.LinearRing(...); select.getFeatures().getArray()[0].getGeometry(...
1
vote
2answers
51 views

Coordinates of image corners for ImageExtent in Openlayers 5?

It is possible to get the coordinates of the four corners of the image, given the center of the image coordinate? or the bottom left and upper right corners? Currently, I am center the map in the lat/...
4
votes
1answer
152 views

Styling rendered mbtiles in offline web-map service

I am building a digital cartography tool that needs to run completely offline. As a basis, I downloaded a .mbtiles-file corresponding to the area I want to survey and I am running the excellent ...
0
votes
1answer
649 views

Using OpenLayers for projection of static image on worldmap?

Using the latest OpenLayers, I'm trying to overlay a simple static image over the regular OSM streetmap. Although there are examples how to overlay an simple static image which is in the same ...
3
votes
4answers
5k views

Drawing box arround text in OpenLayers 3?

I need text labels with surrounding a box and a specific fill color. Actually I have the following function which only shows the text but I don't know how to draw a box around the text. Text length is ...
3
votes
1answer
67 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

How to change tileSize in XYZ from default([256,256]) to something else for openlayers?

I am trying to change the tile size and I have not been able. Below is the code. var projection = get('EPSG:4326'); local_url = 'assets/tile/{z}/{x}/{y}.png'; map = new Map({ target: 'map', ...
0
votes
1answer
175 views

Openlayers 3 polygon-feature “collision”?

I am currently building a webapp using openlayers 3. I build in "GPS-tracking" as a features and I got some questions with that. So, is it possible to run a function if a GPS-Position as a point-...
1
vote
0answers
15 views

Setting FontFamily in OpenLayers Text Label

Changing the font-Family of a style objects' text label does not have an impact - it always looks the same, no matter what font-family I set. Do I have to provide the respective fonts to openlayers ...
2
votes
0answers
29 views

MapServer Query Raster for Pixel Value at Point

I am working with a MapServer and a map file that is displaying a color-relief image. LAYER NAME "sum" DATA "sum.vrt" TYPE RASTER STATUS ...
1
vote
1answer
37 views

Getting non overlapping bbox in OpenLayers?

I have tree bbox as follow: bbox 1, bbox 2, and bbox 3. Now I want to get Final bbox from bbox 1 in OpenLayers 5. How?
1
vote
0answers
27 views

How to display my XYZ Tiles at a certain extent

I am using OpenLayers to create a map. I am providing my own source using XYZ. I want to be able to display my tiles at a certain extent and not go out of this extent. How can i do this ? proj4.defs('...
1
vote
1answer
23 views

WMTS from GeoServer to OpenLayers is Unknown TILEMATRIX X

I tryed use default WMTS layer with GeoServer source. Code looks like that: var projection = ol.proj.get('EPSG:3857'); var projectionExtent = projection.getExtent(); var size = ol....
3
votes
2answers
12k views

Writing style function in OpenLayers?

I am attempting to write a style function within an OpenLayers 3 application that will change the fill color of a circle based on an attribute from a GeoJSON piece of data. I have looked over stack ...
0
votes
1answer
240 views

Reading geojson properties in openlayers 4?

My code is very simple. This is my vector-source and this is how I render my geojson : var vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), url: 'some_geojson_is_here' }); ...
0
votes
0answers
25 views

OpenLayers 5: requesting WMS layer without CRS like in OpenLayers 2

Back in the day of OpenLayers 2 displaying a WMS layer involved something like: var map = new OpenLayers.Map( 'map', {maxExtent: new OpenLayers.Bounds( -20037500.000000,-13347182....
0
votes
1answer
214 views

Openlayers error: Uncaught TypeError: t.getLayerStatesArray is not a function

I am getting the following error in the yellow background below. Can anyone explain why i get this? I am not using any bundler i include the ol.js javascript file in the footer Group.js:209 ...
0
votes
1answer
105 views

Clicking polygon in OpenLayers map and zooming , centering polygon in map?

I click on the map on a polygon and I'd like to zoom the map and center it around the polygon. We have done so until now: map.on ('click', function (e) {      console.log (s);     // coordinate = ...
1
vote
0answers
58 views

Get Modified Feature from Modify Interaction

THIS QUESTION IS STILL OPEN AND OF INTEREST Openlayers: 4.6.5 I have a Modify Interaction and two active Select Interactions. The Modify Interaction is instantiated like this: var interaction = ...
1
vote
1answer
176 views

GeoServer GeoWebCache caching wrong resolution tiles from USGS WMS

I have a simple OpenLayers 3 map with a topo layer that is cascaded from a USGS WMS through my GeoServer / GeoWebCache system. The tile zoom level resolution is correct when the GeoWebCache is turned ...
0
votes
0answers
27 views

Multiple OL views for single OL Map instance

I need to show multiple views of the same OpenLayer Map instance. Each view would have a different extent, but display the same layers visible on the Map instance. Is that possible? It's important to ...
0
votes
2answers
104 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 JavaScript ...
3
votes
1answer
47 views

Using a projection other than Mercator with proj4js 2.5 and OpenLayers 5.3

I am following the OpenLayers FAQ regarding the use of coordinate systems that do not rely on the infamous Mercator projection. I thus produced a very small HTML with a simple example that could be ...
0
votes
0answers
27 views

WMS GetFeatureInfo JSON error

I'm trying to get informations from geoserver with AjaX jQuery of my spatial data at the clicked point using WMS GetFeatureInfo. But I have this ERROR : http://localhost:8082/geoserver/schemas/...
1
vote
1answer
264 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. ...
0
votes
1answer
154 views

OL3 gwc background layer does not align to gridset, works in OL2

I'm using GeoServer 2.10.1 and its built-in GeoWebCache and am trying to use a cached background layer in a custom gridset with a local epsg to work in a simple Ol3 app: proj4.defs("EPSG:3010","+proj=...
0
votes
1answer
2k views

Openlayers 4 and View Extent

I have been working on openlayers 4 and specifically my question is regarding limiting the extent the user sees, let's say 2 km by 2km is the viewing area, this configuration was done using the ol....
1
vote
0answers
44 views

Extracting bounding box from the polygon geometry in OpenLayers

Suppose I have a geometry like below: POLYGON((8744004.877693035 1958621.044138512,8744013.76051175 1958620.4469742286,8744019.582863515 1958613.8781671105,8744018.98569923 1958611.3402189056,8744015....
0
votes
1answer
374 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
2answers
2k views

OpenLayers ECQL BBOX and INTERSECTS: Can I set SRS name?

I am using GeoServer and am trying to understand one problem: Using this statement returns successfully the polygon intersecting with my BBOX. The layer is EPSG:2193 http://myserver/fwsys/wms?service=...
0
votes
0answers
28 views

Tiled WMS server producing no data on Openlayers map?

I've been investigating setting up a server with OpenLayers which will display tiled data from a datacube-ows wms server. At the moment I have an index.html file which initializes the server and a wms....
0
votes
0answers
34 views

Error when adding single image layer from WMS server

No one question from stackExchange with similliar title works for me. Cause I face another situation. I added WMS layer, and chrome's debuger throws this Group.js?d2e6:207 Uncaught TypeError: layer....
0
votes
1answer
665 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
23 views

Add parsed GeoJSON points to OpenLayers and make them Clickable

I have points layer, displayed in OpenLayers map. I want to make them clickable, so when I click on every point I get the property I want (ex: coordinates). I'm newbie in OpenLayers and don't know ...
1
vote
1answer
86 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 ...
3
votes
1answer
1k views

OpenLayers3 how to limits the drag range of the map

I use OpenLayers3 to display a tile map, but there is a blank area on the top and bottom of the map, how to limit the drag range so that it does not display the blank area.
0
votes
1answer
315 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 ...
3
votes
2answers
12k views

Load GeoJSON file in OpenLayers 3?

Before, to load my .geojson, I had a php file who generated the code : var vector_limite_comm_white = new ol.layer.Vector({ source: new ol.source.GeoJSON({ url: 'geojson1.php', ...
1
vote
1answer
143 views

OpenLayers WMTS reprojection

I have a WMTS service URL, which gives me three layers in projection - WGS84_Pseudo-Mercator (tileMatrixSet). It's very easy to add them using this guide -> https://openlayers.org/en/latest/examples/...
1
vote
0answers
46 views

Limit custom tiles to certain extent in OpenLayers

I want to fit my custom tiles at a certain region. For example let's say i have custom tiles for a certain country (example: USA) and I am using OSM or anything at all. How do i make sure that my ...
2
votes
1answer
26 views

Clear Vector source without recursively calling the sources loader method

OpenLayers v4.6.5: var source = new ol.source.Vector({ format: new ol.format.GeoJSON(), loader: function() { return $.ajax({ url: ...
1
vote
1answer
54 views

Qgis2web WMS popup on everywhere click on map [closed]

i have generate a web map by using qgis2web plugin. The map contain 2 wms layers from my geoserver and one OSM basemap. the popup working nicely when click on the feature. but there is empty popup ...
0
votes
0answers
38 views

Issues printing OSM basemap using MapFishPrint 3

I'm trying to get the GeoExt MapFishPrintProvider function mentioned in this other post to work. However, the debug tools are writing this message to the console: "Couldn't find a suitable ...