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
0answers
31 views

WFS-T geometry name problem OpenLayers

I am sending my modified features to database with transactional WFS. The problem is when I render my vector features on map their property name which describes geometry is changed to 'geometry' and ...
2
votes
0answers
29 views

Can declutter work with MultiPoint features?

I have a vector layer with Point data. There could easily be between 10K and 30K features to render, each feature with their respective label, so decluttering is needed. My goal is to have the ...
0
votes
1answer
28 views

OpenLayers Get Column Value Of Currently Selected Feature Having JSON Data Source

I have a service that return data in json format as the following snippet: {"type":"FeatureCollection", "features":[{"type": "Feature", "id": 1, "sheet_no": "NF4011D", "geometry": {"type":"...
1
vote
0answers
34 views

Show geospatial TIFF as base layer in OpenLayers using GeoServer

I am trying to show a GeoSpatial TIFF file as a base layer in OpenLayers, on which further layers can be imposed. Upon trying to add the TIFF file as GeoTIFF store GeoServer throws below error: ...
0
votes
0answers
16 views

Making GetFeature return only specified parameters in OpenLayers?

OpenLayers allows to set parameters and filters for getFeature requests with writeGetFeature, which is great, but the returned features contains the full information of the feature. In my case I need ...
1
vote
1answer
17 views

Setting OpenLayers filter with PropertyName?

I'm trying to get a feature with a getFeature request that filters features by their unique id with IsLike. This is the filter on the POST request: <GetFeature xmlns="http://www.opengis.net/wfs" ...
1
vote
1answer
34 views

WFS request returns FeatureCollection with no feature - OpenLayers

Created the WFS feature request as following: this.map.getViewport().addEventListener("click", (evt) => { //Point transformation to EPSG:25830 var proyeccion = getProjection('EPSG:25830'); ...
1
vote
1answer
40 views

Get WFS feature from click coordinates OpenLayers?

I have an OpenLayers map with a WMS background layer. When clicking the map, I need to draw the WFS feature located on the click. Note that the vector layer is not loaded yet. I must load/request ...
1
vote
1answer
21 views

Getting field from getGetFeatureInfo in OpenLayers?

I'm making a getGetFeatureInfoRequest() as following: this.map.on('singleclick',(evt) => { var viewResolution = /** @type {number} */ (this.map.getView().getResolution()); var url = this.layer....
1
vote
1answer
22 views

SVG does not show up in OpenLayers

I tried adding an SVG as a layer on my map but it does not show up. //For registering EPSG: 2326 import * as proj4x from 'proj4'; var proj4 = (proj4x as any).default; import {register} from 'ol/...
1
vote
0answers
43 views

Applying style from QGIS to OpenLayers VectorLayer?

I have a vectorlayer exported from QGIS and added to an openlayers map. I now want to style this layer according to the style I use in QGIS. It consists of numerous line features and they should be ...
1
vote
1answer
37 views

Get feature by ID in OpenLayers

I have a VectorLayer layer with a feature collection in GeoJSON. The GeoJSON format is as following: { "type": "FeatureCollection", "totalFeatures": "unknown", "features": [ { ...
1
vote
1answer
24 views

View renders WFS response at a different location

I am querying a feature from WFS using ajax call. Feature from the WFS response is captured but when I am fitting the extent on view so that the queried feature is visible on screen it zoom to ...
1
vote
1answer
22 views

Scale line is not affected by css color of ol-scale-line class

I try to change the color of the text inside the scaleline created with Openlayers via new ol.control.ScaleLine. To change the color I refer to the scaleline in my css sheet the following way: .ol-...
0
votes
1answer
19 views

Drag Vertices - ol2 Modify Control vs. ol3+ Modify Interaction

In OpenLayers 2, clicking a geometry with an active modify control running, created a drag vertice on every edge of the geometry which could be used to modify the geometry by dragging. In OpenLayers ...
0
votes
1answer
28 views

OpenLayers map with custom projection not showing WMS

Trying to add to my map an WMS layer with custom projection When executing, the map does not show any layer. Custom projection: proj4.defs("EPSG:25830","+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,...
3
votes
1answer
47 views

WFS layer not printed in OpenLayers Map?

This is the WFS service I'm using: https://idena.navarra.es/ogc/wfs?service=WFS&version=1.1.0&request=GetFeature&typename=IDENA:DOTACI_Sym_AlojTur&outputFormat=application/json&...
1
vote
1answer
27 views

Setting OpenLayers line labels by angle?

I want to write labels near linestring features on my map. I calculated but it works wrong. My layer style function is like following: layerFeatures = new ol.layer.Vector({ source: ...
1
vote
1answer
22 views

OpenLayers: projection of WMS and vector layers

I have two layers in my OpenLayers map, the background in WMS and GeoJSON features in a vector layer, both in ESPG:3006. (And a standard OpenStreetMap background just to see which one of the layers ...
0
votes
0answers
21 views

Using async condition callback with the select interaction?

The select interaction allows us to pass in a condition callback that is supposed to return a boolean indicating to Open Layers wether or not a specific event should be considered for the interaction ...
0
votes
0answers
22 views

OpenLayers3 map.forEachLayerAtPixel bug

Hi I'm working with OpenLayers version 3 and using method map.forEachLayerAtPixel(). The problem is I usually work on big screen and now I have switched to my laptop with smaller one and suddenly ...
1
vote
0answers
35 views

OpenLayers OpenStreetMap OSM not rendered

I am trying to render a part of OpenStreetMap offline, previously loaded as map.osm (OSM XML). I'm starting a localhost and loading the xml from disk. I tried to use similar example (https://...
2
votes
1answer
24 views

Fit view to ImageStatic size

In OpenLayer 5, i've a long rectangular SVG image (like 7000x600 px) as main layer. I need to limit the view and pan only to its bounds. I tried the code below, but when zooming the layer can't panned ...
0
votes
0answers
31 views

Expose GeoServer Services to openlayers using .NET application

I have came across ways to consume GeoServer wms services and Bing maps at client side using openlayers , But openlayers is Javascript based framework and using this the Bing Map keys/ WMS urls and ...
1
vote
1answer
35 views

Plotting WFS layer from ArcGIS Online with OpenLayers?

I would like to plot WFS layer with OpenLayers. I tried with a sample WFS stream at first and succedeed. WFS stream : https://ahocevar.com/geoserver/wfs?service=WFS&version=1.1.0&request=...
0
votes
0answers
17 views

get Map's Scale in OpenLayers3+

In OpenLayers 2, it was easy to get the current Scale by just calling map.getScale(). Somehow, this disappeared in OpenLayer 3+. How do I get the current Scale then and why did it have to disappear?
0
votes
0answers
28 views

Highlight the filtered Features using CQL_FILTER on map

I have a WMS service with multiple layers which I am consuming within a single source through Layers Param. I need to filter features for few layers from the service. I am able to get the updated ...
1
vote
1answer
31 views

Drawing more complex graphical objects in OpenLayers?

I'm beginner in OpenLayers and I'm wondering how to draw more complex graphical objects such as the following: I've taken a look at their examples, but not found that kind of drawings. I'd like to ...
0
votes
0answers
13 views

How to use SVG file as the source for a layer in OpenLayers

I found this solution online but this is defining your own projection. I do not want to use the projection below, I want to use 'EPSG:2326' and put the svg file over the map such that it overlays on ...
1
vote
0answers
50 views

qgis2web - show specific layers in layer list

Is there a way to display specific layers in layer list when exporting map with qgis2web plugin? I have created a map with bunch of layers like roads, names of places, rivers etc. but i don't want ...
0
votes
0answers
21 views

Custom feature labels based on properties

In OpenLayers 2, I used to custom style features based on indirectly referencing variables like style: { label: "${feature_id} ${feature_name}" } where feature_id and feature_name were ...
1
vote
0answers
43 views

Use svg file in openlayer to represent a layer

I want to use an SVG file as a source for one of the layers for my map in OpenLayers. The svg file is in a coordinate system such that it overlays my coordinate system of my map. I have tried the code ...
1
vote
1answer
70 views

Get Attributes from Multiple overlapping WMS layers

I am working with Openlayers to consume WMS from GeoServer. I have loaded multiple layers and get attributes for one layer using getGetFeatureInfoUrl. But this approach gets attributes for the ...
0
votes
1answer
23 views

Labeling a GeoJSON with OpenLayers 5

I'm trying to put a label over a polygons. My polygons cames from a GeoJSON serialized by GeoDjango. I'm be able to categorize this polygons using the attribute "type" but I wanto to see the height as ...
0
votes
1answer
41 views

Map render complete event is not triggered - Openlayers 5

I have written a function in Map render complete event to hide the progress icon if all map tiles are rendered. But the map render complete event is not fired after I added a empty vector layer on map....
0
votes
0answers
47 views

Implementing “conformal mapping” in OpenLayers?

I want to preserve shape of objects, so how do I implement "conformal mapping" in openlayers 4.6.5? My current objects: I have several geoJSON objects (WGS84) around the globe in long/lat with a ...
0
votes
0answers
26 views

Suitable syntax of OpenLayers code for asp.net MVC?

I think all the examples are suitable for using in nodejs (npm). For example, although I attached openlayers.css and .js file to the asp.net MVC project, I can't use ol keyword or mouseposition method....
1
vote
0answers
33 views

WMS line layer is not visible in Openlayers

I have few shape files (Polygon/Lines/Points) imported into Postgres. I have published the Layers in Geoserver. The Polygon layer is displayed properly in Openlayers However when I consume Line Layer ...
1
vote
0answers
26 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
56 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
47 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
39 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
70 views

Using Mapbox vector tiles from Geoserver in OpenLayers

Currently this error code is the only result: Uncaught Error: Unimplemented type: 4 at Pbf.skip (index.js:191) at Pbf.readFields (index.js:41) at MVT.readFeatures (MVT.js:250) at ...
2
votes
1answer
27 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
83 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/...
1
vote
0answers
23 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
35 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
0answers
36 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
38 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
1answer
38 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....