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

Questions tagged [openlayers]

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

-1
votes
1answer
14 views

How to fit WMS layer on OpenLayers 3

I can't find exact solution for https://stackoverflow.com/questions/28077115/openlayers-3-get-layer-extent this question. I have very similar problem for that.
0
votes
1answer
13 views

Finding centroid on multipolygon? [on hold]

I have a response in the below format. ["MULTIPOLYGON(((155883.556336412 210822.648657794,155883.596189326 210822.649920977,155883.635814866 210822.654355722,155883.674961037 210822.661933825,155883....
0
votes
0answers
9 views

getFeaturesAtCoordinate() returns empty array

For some features I get an emtpy array with getFeaturesAtCoordinate(). The WFS - GeoJSON is perfectly homogeneous. How can that be? search.on('select', function(e) { select.getFeatures().clear()...
0
votes
0answers
12 views

Mapbox.js (or GL) with Openlayers

Our initial need is to have a GIS tool that overlays images on a map which is not facing north. In our research we have seen that only Mapbox and Openlayers support this. Along with that we want ...
2
votes
1answer
25 views

OpenLayers: how to modify existing feature attributes given feature id

I am using OpenLayers to view features from a layer from GeoServer. I use WMTS to display the layer when the zoom is within a certain range. I use a WMS query to look up the feature id, and other ...
0
votes
1answer
18 views

bbox loading problem

Could you tell me why bbox loading all data beginning? 'bbox=' + extent.join(','); }, strategy: ol.loadingstrategy.bbox The map then loads very long. How can I make it calculate correctly?
1
vote
1answer
15 views

Openlayers 5 zoom control has + but zoom out button has “−” - any idea why?

Doesn't seem to matter what browser I'm using. I have the prebuilt ol.js v5.2.0. As well as the prebuilt ol.css Here is the code to create the view, it doesn't get any simpler: <html> <...
1
vote
0answers
26 views

WMS - understanding <Min> and <MaxScaleDenominator>

I am working on a personal web gis client and the first thing I am implementing is support for OGC WMS 1.3.0. Right now, I am in the middle of greying out layers in my layer tree which are not ...
0
votes
0answers
26 views

How to get area labels from GML file?

I would like to know how to create labels in polygons. The loaded areas are empty. I have to patch the names of these areas from the file.
0
votes
3answers
36 views

Support for WFS 2.0 in QGIS 3.2.3 or geotools

I have problem with this WFS server: http://mapy.geoportal.gov.pl/wss/service/PZGIKINSP/httpauth/rest/services/PZGIK/PRG/GeoDataServer/exts/InspireFeatureDownload/service?service=wfs&request=...
1
vote
0answers
19 views

Pros and Cons on loading vector data from ESRI Shape file and Geoserver using OpenLayers 5 [on hold]

I am developing a web map application to show the vector data on top of Openstreet map using the open source technologies such as Openlayers v5.2.0. But bit confused to take a decision in what method ...
1
vote
0answers
33 views

Openlayers - get properties from automatic searching selection

I want to get the feature property from a selection. The Selection is comming from a search reference, from the openlayers extension (by http://viglino.github.io/ol-ext/). It works almost everything, ...
1
vote
0answers
31 views

Find feature by property from multiple layers

What is the best way to find a particular feature by a property (let's say id), where the feature could exist in one of many layers? I could theoretically step through all the layers, and step through ...
0
votes
1answer
22 views

Openlayers 5 change kml style for icon only

I'm importing KML into my map where it has some point placemarks with images that are WAY too big. What is the best way to import KML in the map, and just change 1 aspect of the style ( https://...
0
votes
1answer
30 views

Showing route between two points in open layers 3

How will I show the route between 2 points? I have created points with below code. var iconFeature = new ol.Feature({ geometry: new ol.geom.Point([8637791.36, 1456487.82]), name: ...
0
votes
0answers
24 views

Add line programatically in OpenLayers 3?

I successfully added point like this: var iconFeature = new ol.Feature({ geometry: new ol.geom.Point([8637791.36, 1456487.82]), name: 'Police Station', population: 4000, rainfall: 500 }); ...
0
votes
1answer
19 views

WMS Single Tile Requests are not displaying in right location?

I'm querying an ArcGIS Server in OpenLayers v5.2.0 to try to get a single tile WMS returned to minimize requests to the server. I have been able to get the data to plot, but it's displaying in the ...
0
votes
1answer
38 views

GetFeatureInfo on mouse hover on feature in OpenLayers 3

I am able to get popup onclick on the feature but want to get popup also on mouse hover on the feature (polygon,point). Can anyone help me out. For onclick I used below code - var feature_onClick; ...
0
votes
1answer
24 views

Add a polygon programmatically in OpenLayers 3?

I added a point like this and it works fine, but for polygon it's not working. var iconFeature = new ol.Feature({ geometry: new ol.geom.Point([8637791.36, 1456487.82]), name: '...
1
vote
0answers
29 views

How to differentiate between features and labels for select interaction and applying styles in OpenLayers?

I am using a style function to style a vector layer with text labels. For the text style I have set overflow to true so that labels can exceed the dimensions of a polygon. I now want to use another ...
0
votes
3answers
32 views

Creating WMS proxy without capabilities document?

I've recently been tasked with making a custom written WMS server be usable with newer clients and apps such as QGis. The original server was written years ago by a consultancy firm in C++ and who ...
0
votes
1answer
66 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....
0
votes
0answers
32 views

Open WFS in OpenLayers

I'm starting with GeoServer. What I am trying to do is open my GeoServer layer as WFS using OpenLayers so I can edit it as a feature, however I am not understanding how to put the URL. Follow the code:...
1
vote
0answers
43 views

Difference between an interaction and eventListener in OpenLayers

I am wondering when should I use an interaction instead of an eventListener. For example I can have a handler function like this: function handler(evt) { if (evt.type === 'click') { console....
2
votes
0answers
46 views

Is WPS supported by Openlayers 5?

As far as I can see the up to date version of Openlayers is 5.2. I am trying to connect my Openlayers to my WPS but I have no luck doing so. All the info I can get says that there was WPS support in ...
0
votes
1answer
35 views

Displaying WMTS-Layer in custom projection (EPSG:25832) using OpenLayers?

I have the URL of a WMTS server which provides map tiles in EPSG:25832 (ETRS89 / UTM zone 32N; I'm sorry I cannot post it as it contains user credentials). If I connect to this server with QGIS I can ...
1
vote
0answers
32 views

Why does loading speed of GeoServer services vary so much, how to optimized settings?

We are running web services in GeoServer 2.14. Loading tiled WMS layers in an openlayers application. Polygons, lines and points. One layer published from a table holding several million records and ...
0
votes
0answers
29 views

Openlayers with Mapserver

I have setup a map server in my local Windows machine, and can access the map with this link http://localhost/cgi-bin/mapserv.exe?template=openlayers&layers=all&map=C:/ms4w/apps/osm/basemaps1/...
2
votes
1answer
41 views

Display encoded polyline with OpenLayers

I try to display routing path on OpenLayers map, but the path is rendering wrong. Back-end returned encoded polylines are displayed in Africa, but it should be in Poland (image below). I tried to ...
0
votes
0answers
16 views

OpenLayers Tile setVisible doesn't work consistently

I have a Single Page App that loads it's HTML Views asynchronously. On one page is an OpenLayers (v4.6.5) map. There are multiple Tile WMS layers on top of a base layer, and there are buttons to turn ...
1
vote
1answer
30 views

Add NOAA layers to OpenLayers map

I'm trying to add a NOAA hosted layer to an OpenLayers map. I've seen some examples of doing it with an older (pre 3) version of OpenLayers and of services no longer offered by NOAA. Has anyone ...
2
votes
0answers
35 views

OpenLayers - Get centroid from all WFS Features and create Marker

I would like to generate dynamic markers, calculated from the centroid of WFS polygons. I only have a selection with log.console of individual features to get the Centroid. But I want it without an ...
2
votes
2answers
39 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({ ...
0
votes
0answers
13 views

Openalayers : How to know map container id's from map object

After rendering multiple maps using openlayers , I want check which map is in which div . if (!this.previewMapLoaded) { this.mapService.loadMap('previewmap', 'preview', extent); if (!this....
0
votes
0answers
14 views

Open Layers with Geoserver WFS-T - PointOutsideEnvelopeException [duplicate]

I'm using OL with Geoserver to do a WFS-T request and getting the below exception in my Geoserver log when trying to save. The map projection is in EPSG:4326. Caused by: org.geoserver.wfs....
0
votes
2answers
45 views

GeoJSON coordinate projection

The coords variable has been tested with 3857 and 3067 data. Using the below code, I understand it should expect 3067 and output as 3857. However, 3857 code coordinates work fine (and I assume they ...
1
vote
1answer
36 views

Google Streets XML as raster layer

I found Why are the Google basemaps no longer appearing in QGIS? which explains a simple method to reach the google tile server and get the Google Physical tiles. Has anyone a similar code with which ...
1
vote
2answers
25 views

Need to zoom into a vector Layer of a multipolygon

I am getting a multipolygon coordinates from DB in WKT format. I am able show the same on the map. But the problem I am facing is while zooming to center of the Multipolygon. Is there any way to zoom ...
0
votes
2answers
62 views

OpenLayers 5 - WFS Projection Issue

I'm having trouble rendering my WFS features in projection EPSG:4326, the below code works when I switch projection to EPSG:3857 (and change the center), it works fine. I've checked the response from ...
0
votes
1answer
30 views

Code from 3067 to 3857, not drawing polygon

Below is a copy of my function, its working without errors. I consloe.log the coords and they are correct, but obviously in 3067 format. If I remove the code for projection, the 3857 coordinates ...
0
votes
1answer
20 views

Need to draw a map with Multipolygon coordinates using OL3

I am getting a response from my DB(postgresql), something like this: ["{\"type\":\"MultiPolygon\",\"coordinates\":[[[[155917.153194497,210867.51599128],[155917.193016207,210867.518011615],[155917....
1
vote
1answer
34 views

Calculate coordinate for a point along given line

Using Openlayers or plan Javascript, how would i get the coordinate of a point that is 500 meters along this line? Im trying to calculate the coordinate (lat long) x meters along a given line Example ...
0
votes
1answer
24 views

Openlayers only Popup for Marker but NOT for Polygon [duplicate]

I only want popups for the layer of the markers (icon), but not for the layer of the polygons (WFS). var defaultStyle_polygon_1 = new ol.style.Style({ fill: new ol.style.Fill({ ...
1
vote
1answer
51 views

How to slow down mouse before modifyend with openlayers3

I have a map with a draggable marker (ol.style.icon in fact). There is a strange issue: If I try to move marker, it is like trying to reel in a marlin but after a zoomin/out, marker naturally slows ...
0
votes
1answer
63 views

OpenLayers 5 Vector Tiles Styling and ESPG:4326 projection issues

I have a OL5 map using a projection of EPSG:4326. I am adding a Vector Tile layer with a projection of ESPG:4326. I am using Open Layers Mapbox Style (https://github.com/boundlessgeo/ol-mapbox-style) ...
-1
votes
1answer
39 views

Openlayers 5 hide layer

How can you show/hide a layer (not a feature) in openlayers 5? There is a visible parameter to the TileLayer object i'm working with, but changing that value does nothing. https://openlayers.org/...
0
votes
1answer
19 views

Get WMS layer by user defined ID

I have a map where i'm loading several WMS layers from different urls. I'm trying to figure out a way to turn each layer on/off by an identifier, but i can't figure out how to add a unique identifier ...
0
votes
2answers
46 views

Openlayers 5 VectorSource getextent only of certain features inside source

i have a VectorSource built from GeoJSON, and i know how to get the extent of all the features inside the vectorSource, but i don't know how, or what the best method is, to get the extent only of ...
0
votes
1answer
25 views

“Zoom to search result” function in qgis2web?

I'm a beginner in GIS and have almost no experience in coding but I'm slowly working my way through everything. Right now I'm trying to make an exported qgis2web map a bit more interesting by setting ...
0
votes
1answer
35 views

OpenLayers not requesting tiles at previously visited zoom levels

I have a web app with Maps on several pages using OpenLayers as a client and GeoServer as a backend. The layers are WMS tiles. On one page, if you visit it, and go to several zoom levels (of the WMS ...