Stack Exchange Network

Stack Exchange network consists of 175 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
vote
0answers
150 views

Print Openlayers WMS map with fixed scaling

I need to print a map with a fixed scale (1:500 and 1:1000) on A4. The online map is done with Openlayers, the print request is sent to QGIS Server using WMS getPrint function. I mange to get an ...
1
vote
0answers
29 views

Setup for several origins for a WMTS in OpenLayers

I´m trying to setup a map with a WMTS as a layer with help form this example: https://openlayers.org/en/latest/examples/wmts.html The layer works fine for the first three levels, but after the third, ...
0
votes
0answers
26 views

How we can get respective WMS layer from a WFS layer?

We need to get the respective WMS layer here, ArcGIS Server WMS layer names do not match to WFS names so name matching doesn't work import org.geotools.data.DataStore; import org.geotools.data.ows....
1
vote
1answer
163 views

Removing shapes on a mouse click - Angular 6

So I can remove a layer fine, and I can see how I can remove a feature(shape) by grabbing it's id lets say and populating the list of current features for the user to select. But ideally I want to be ...
0
votes
1answer
24 views

Openlayers 4.6.5 Drawing not populating on map

The code is as follows @Input( 'coreMap' ) coreMap :CoreMapComponent vectorLayer : VectorLayer; modifyLayer : Modify; draw: Draw; vectorSource: VectorSource; style: Style; snap: Snap; ...
0
votes
1answer
42 views

OpenLayers 4.6.5 addLayer circular structure & layer.getLayerArray is not a function

Currently working with OL 4.6.5 and Angular 6 and for the life of me have read the documentation and API references on the OL site http://openlayers.org/en/v4.6.5/doc/ And despite following there ...
0
votes
1answer
220 views

Openlayers 4 custom pop-up for a GeoJSON layer

I need to get popups showing for just a single feature layer (forest -- stored as a GeoJSON) as opposed to all in Openlayers. I currently have the below. var map = new ol.Map({ target: "map", ...
0
votes
1answer
33 views

OpenLayers v5 XYZ source is making 'wrong' requests

I'm trying to add a tilelayer to a map, but the zoom level and x/y coords are not matching up in the network request for some reason. Here's my code for the layer: new TileLayer({ source: new XYZ({...
0
votes
1answer
89 views

Load WFS from ArcGIS Online on OpenLayers 3

My goal is to load several shapefiles and display them using OpenLayers 3 as the basemap. I now have these shapefiles as a Web Feature Service (WFS) on ArcGIS Online. Below is what I have done (...
1
vote
0answers
190 views

Selecting WMS layers from GeoServer in OpenLayers application?

I am making a weather application and I am almost there! I can show my GeoServer WMS-layers in my browser using OpenLayers 5. What I want to accomplish is that the user can switch between different ...
-2
votes
1answer
385 views

Openlayers 5 click vector feature style circle popup [SOLUTION!] [closed]

there is already a working script for OL 3. https://next.plnkr.co/edit/DXnDfStbvbetOtdU Is there anyone who can rewrite that in OL 5? Please as in the example for OL 3 without Ajax, JQuery and ...
2
votes
1answer
657 views

Add image along the LineString

I am wondering how to place images on a line. For example, instead of a dotted or dashed line. I could include a symbol of a cloud a character (e.g. |) repeated along the line. it cannot show the ...
1
vote
2answers
131 views

Remove/Delete a layer or layergroup with mouse click

I add a ol.layer.Vector OR ol.layer.Group with a mouse click in the map. By a new mouse click should the layer removed/deleted AND a new layer should be add. etc. I have search and search and don't ...
1
vote
0answers
83 views

Leaflet - two colors same path

Wanted to know if is there a way to get a single path (line) to have 2 colors? for example one next to each other I want to display 2 different paths (multi poly-lines) at same times, and each one ...
1
vote
2answers
320 views

Zooming openlayers map to fit in selected features

In my openlayers based application, I need to trigger zoom when user selects features so that all the selected features fit within the map extent. I make use of this code: map.getView().fit([swLong, ...
0
votes
0answers
68 views

OpenLayers feature opacity vs zIndex

I'm using OpenLayers 4.6.5. I have a VectorLayer with a couple of circle features that have the same zIndex. The problem is, that the features texts are overlapping although I've set the the opacity ...
0
votes
2answers
147 views

OpenLayers flip coordinate order for BBOX WMS request

I have a WMS layer which have a different axis-orientation to the one that OpenLayers sends out in the BBOX-request. Openlayers uses the BBOX (minx,miny,maxx,maxy): BBOX=1438239.124213878%2C7895639....
0
votes
0answers
45 views

Openlayers 4 ScaleLine not visible

I am debugging a problem in an openlayers-based map application. Some time ago the ScaleLine control stopped being shown and I cannot find why. In the code below, if I change the units to degrees, the ...
0
votes
1answer
41 views

Interacting OpenLayers with GeoServer

I am new to OpenLayers. I need guidance on below. I am able to create map using OpenLayers and able to create polygon interactions on the map and able to extract as GeoJSON object with coordinates. ...
1
vote
1answer
112 views

Color blurring on GeoServer WMS layer loading using OpenLayers 5

I am using GeoServer 2.14.1 and OpenLayers 5 API to view the polygon data to my web map application using WMS service. I have used simple polygon style with black color.When zooming, the color of the ...
0
votes
0answers
39 views

OpenLayers 4 ruler

I'm refactoring the whole code of the app with modules and I'm having some problem with the Ruler function of OpenLayers 4 now. In the previous code was working OK, but now when I double click on the ...
1
vote
1answer
89 views

Load vector features without adding the layer to the map in OpenLayers

Is it possible to make a vector source load and reload features without adding/removing its parent layer to the map? I need to do that after my viewparams url variable changes. My vectore source ...
0
votes
1answer
249 views

Function in OpenLayers 5 JavaScript does not work

I am making a weather application and it is essentially working. (It is my first GIS-application, so I am really glad with that!) It is just still very basic. I made de application with PostGIS, NPM ...
0
votes
1answer
53 views

OpenLayers/Geoserver rendering transformation is failing at the Prime Meridian

I have a layer that represents surface pressure in GeoServer. I am using a rendering transformation SLD to generate the contours. When I try to map it in OpenLayers, the contours show up fine when ...
1
vote
0answers
172 views

OpenLayers. Slow map after render heatmap even when I clear the layer source

I'm working in a map with about 10 layers and it works fine, when I create a heatmap it becomes slower, that's something I was expecting, because the source has about 2000 points. When I want to make ...
0
votes
1answer
55 views

How to set individual feature angle in Openlayers

I have an application where each element has an angle. I can use "Angle" function in "style" but not individual. Is there any way to apply angle individually? function DesenhaPonto(Id, Estilo, ...
0
votes
1answer
79 views

Clip OL TileLayer by Vector AND stop it from fetching the tiles

I'm trying to clip a layer by vector in OpenLayers 5. I've found this answer that kind of works, but it does not solve my specific problem, namely bandwidth. I'm combining WMTS services from two ...
3
votes
1answer
97 views

Geoserver's scale values corresponds to OL's zoom levels

I have a PostGIS table that contains geometry, min_scale, and max_scale fields. The PostGIS table is published as a Geoserver layer with EPSG = 4326. I have created a CSS Style Doc that will show each ...
0
votes
1answer
317 views

Bounding box coordinates and strange WMS behavior

I'm having trouble with using OpenLayers to render a GeoServer WMS layer. I have searched about it on the internet but have found no workaround yet. I intend to provide as much as I know on this ...
1
vote
1answer
71 views

Mapserver not displaying a raster properly

I have a 32bit floating point raster containing only five values (-2, -1, 0, 1, 2 + -999000000 for noData don't ask me why, it was delivered to me), no compression, projected (EPSG:3857). I am using ...
0
votes
1answer
76 views

GeoServer get native SRS of layer

I want to get the native SRS/EPSG-Code of a layer deployed in GeoServer. Maybe similar to this solution: https://stackoverflow.com/questions/32766126/get-the-epsg-code-from-openlayers-3-layer but with ...
0
votes
0answers
36 views

Generate Markers from WFS via turf.centroid() with Popups

I have successfully made a map that computes points from a WFS consisting of polygons and generates them as markers. The calculation is carried out by turf.js. However, I do not get all the properties ...
0
votes
0answers
224 views

Does OpenLayers 4.6.5 (or latest 5.3.0) support reprojection of VectorTiles in MVT format?

I have been setting up my own MVT-service, which takes some GeoJSON input and convert it to MVT tiles. Then I've used Open Layers 4.6.5 to render the tiles. The testdata I have been playing with is ...
1
vote
0answers
32 views

Openlayers 2: [In Touch] Pinch zoom action triggers click event at the end. How to prevent click on pinch zoom

Openlayers 2: [In Touch] Pinch zoom action triggers click event at the end. How to prevent click event registered on map getting triggered when pinch is done
1
vote
1answer
209 views

Openlayers get list of all layers in Geoserver

How can I get a list of all layers deployed in Geoserver separated by Vector/Raster? Similar to how Geoserver itself does this when one uses the WPS Request Builder (it then shows a complete list of ...
0
votes
1answer
124 views

Openlayers - parse WFS features to create Attribute Table

I am trying to parse this WFS to create an Attribute Table with HTML having the fields as headers and their values as attributes. I saved the GetFeature response in a variable (features) which I'd ...
0
votes
1answer
26 views

Triggering Events on Drawing Geometries

Which events are triggered when I draw, for example, a polygon? Like when I define the vertices of the polygon by clicking? And how can I capture these events? Or, better: Is there any documentation ...
0
votes
1answer
43 views

Customize behaviour of Ol.interaction.draw.createbox() geometryFunction?

I'd like to enable a draw function in an Openlayers 3 application for drawing a rectangle - up to a certain size (in the defined projected coordinate system, in square meters). For this ol....
1
vote
1answer
510 views

How to temporary disable map click event in OpenLayers

How can I disable map click event? My idea is to disable it when I am positioned with mouse over my popup container. After I move mouse out of it, I want that event is enabled again. Something like ...
1
vote
0answers
232 views

OpenLayers : how to dynamically change projection of a Tile Layer?

I've added a tile base map and and a couple of vector layers using OpenLayers. I'm implementing a change map projection functionality. For that, I need to change map projection and all added layers . ...
0
votes
1answer
69 views

MapServer WFS request

I want to request a WFS feature but my mapfile returns WMS, I have tried to change the mapfile but it still returns the WMS. I am using MapServer 7.3 and OpenLayers 4. Below is my mapfile ... ...
1
vote
0answers
52 views

Which is the View.getResolution() units? [duplicate]

In OpenLayers v5, if I have a view defined like this: var view = new View({ center: [952014.59, 5571269.68], zoom: 8 }); , trying to get its resolution doing view.getResolution() outputs 611....
1
vote
1answer
67 views

WKT from current map view in OpenLayers

Trying to find the best way to take the current map view extent const extent = mapView.calculateExtent(); and get a WKT from that value. i thought i might be able to take that extent, convert it ...
1
vote
0answers
112 views

GeoServer SLD contours fail to draw some times when panning (using Layer Preview) [closed]

I am using GeoServer 2.13.2 with netcdf data from ECMWF and all is working fairly well with a fixed extent. As soon as I turn on Map Wrapping (wrapx) in OpenLayers (5.x) then contours, wind barbs, and ...
0
votes
0answers
207 views

OL-Cesium - Example doesn't work

I would like to test the Ol-Cesium on my computer with this example: https://openlayers.org/ol-cesium/examples/oldfashioned.html I saved the olcs.css, olcesium.js and Cesium.js file into my webserver'...
0
votes
2answers
280 views

How to specify custom CSS to an OpenLayers Zoom Control in Angular 6?

I am attempting to modify the Zoom buttons on OpenLayers 5.3 in an Angular 6 component. And I'm using this OL3 question as a starting point: Creating new buttons and removing default ones - Openlayers-...
0
votes
1answer
180 views

Getting data from JSON data API?

As asked in previous question: Displaying icon name next to icon using OpenLayers? , now I need to change data source to the JSON API data, and used jquery plugin bypass CORS (http://www.ajax-cross-...
0
votes
2answers
145 views

OpenLayers: cannot register custom projections

I'm trying to load an OpenLayers map with UTM projection. If I try to register custom projection, the map becomes blank. proj4.defs('EPSG:32640', '+proj=utm +zone=40 +datum=WGS84 +units=m +no_defs'); ...
0
votes
1answer
184 views

Openlayers displaying local pbf at wrong location

Need help for displaying of local pbf file, it does show tiles but at wrong location and when zoom-in the whole feature set split into 4 locations. First Openlayers v 4.6.5 is not displaying local ...
0
votes
1answer
748 views

Why is my openlayers map not showing?

I'm trying to create a plunker to find out a solution when adding projection list in Openlayers. But when I add a sample map, it's not showing the map and there is no error in the console either. ...