Questions tagged [openlayers]

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

737 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
297 views

Consuming GeoServer UTFGrid output in OpenLayers 3 ol.source.TileUTFGrid results in error processing response object

GeoServer now supports UTFGrid outputs for layer services. This is great however the support for consuming them seems incomplete in OpenLayers 3. I set up a simple map to attempt this but can't get ...
2
votes
0answers
395 views

Calculating extent of custom tiles?

Problem The picture is just an example of my case, but I am left with blank space on the left when I load all the tiles and I get error message in the console: Failed to load resource: the server ...
2
votes
0answers
104 views

Overlaying a matrix of intensities over the world map

I have a matrix that covers the whole world, with a different intensity per coordinate. I want to overlay these intensities on top of the world map. I was originally using a vector layer, dividing he ...
2
votes
0answers
131 views

Can OpenLayers 3 run without browser or is it designed to be used only in browser?

I need to run OpenLayers app which will render some map into canvas and then I need url of that canvas ( Canvas.toDataUrl() ), I would use NodeJS and Node Canvas to get it done. I wonder can ...
2
votes
0answers
441 views

OpenLayers 3 get interaction draw style

After creating a draw interaction: var draw = new ol.interaction.Draw({ source: vector.getSource(), type: /** @type {ol.geom.GeometryType} */ ('Polygon'), }); Is there a way to ...
2
votes
0answers
652 views

Map gear's OL3-Google-Maps not showing the google layer even after adding google layer

I am using Map Gear's OL3-Google-Maps in order to load the google base map in OL3, I am adding like this //Before adding this i am removing the OSM base map tile layer and adding it. var googleLayer =...
2
votes
0answers
1k views

OpenLayers 3 - Adding layer with administrative labels and borders

I am in the process of migrating a website from the Google Maps API to OpenLayers 3. This site shows a map with custom tiles and administrative labels and borders on top of them (country/region/city ...
2
votes
0answers
234 views

Creating Point Grid over selected polygon using OpenLayers 3?

I am trying to create an equally spaced grid of points. But these points must only be on land. I was using the polygon overlay of countries to see if I can use that as a mask. I have also tried ...
2
votes
0answers
385 views

OpenLayers 3 initial extent

I know that ol3 view accepts center and zoom parameters to properly position the view. Is there a way to initialy render map that fits to provided extent [xmin,ymin,xmax,ymax]? If no how to calculate ...
2
votes
0answers
820 views

Assigning multiple styles for same layer from GeoServer in OpenLayers 3?

This is my code, the function set style is not working osm background layer. I have many sld files for one layer and I want apply them on the same layer: <script> var untiled = new ol.layer....
2
votes
0answers
962 views

Geoserver WFS Layer in OL3 tilted and mirrored

I am using Geoserver (2.4.2) to display a WFS-Layer in Ol3 (3.13.0). I successfully used this example from a fellow user to get things going. Here is my modified code. I am sorry for not providing a ...
2
votes
0answers
177 views

Bind Vector Geometry to ViewModel or How to keep track of modified points?

I'm trying to create a viewModel for my application and the data is typically populated by a call to a database. I can retrieve the coordinates and convert this to geometry which can be displayed on a ...
2
votes
0answers
731 views

Buffer Distance Problem with TURF AND OL3

I had this code for my turf-buffer : var unidades = 'kilometers' select2 = new ol.interaction.Select({ condition: ol.events.condition.click }); map.addInteraction(select2); select2....
2
votes
0answers
271 views

Unable to load and display data from geoJSON source in OpenLayers

It seems like OpenLayers library changes from day to day and loses compatibility with the previous minor version each time... But, actually, I have another question to ask. The problem I face, is that ...
2
votes
0answers
568 views

Showing marker upfront in OpenLayers 3 while drawing polyline?

I am drawing the polylines on the map and displaying few marker as well which is working fine but when the polyline is drawn marker is above the line I wanted to know how to show the marker upfront ...
2
votes
0answers
124 views

Openlayers 3 screws up rendering of vector data on high zoom

I'm working on a web app that needs to show a lot of detail. It's also loading a geoJSON file as background, but I have problems with it when zooming in. It's like the vector renderer doesn't find ...
2
votes
0answers
495 views

WMS Bad request in OpenLayers 3

I have used OpenLayers2 in order to show a layer with points from Geoserver. I try now to transform the code from Openlayers2 to OpenLayers3 but I am facing some issues. I have walked through this ...
2
votes
0answers
1k views

Setting the initial scene of OL3-Cesium map in Tilt View

I have two maps. One of them is using CesiumJS library, and the other map is using the OpenLayers3-Cesium integration library. What I need to do is set the initial scene of the maps in Tilt View. ...
2
votes
0answers
432 views

GeoServer WMS Layer not shown in Web page

I want to show the below link in a web page created asp.net. Please answer me in detail how to do this using OpenLayers latest version 3.7.1. http://192.168.0.123:8080/geoserver/MilkywayWS/wms?...
2
votes
0answers
1k views

OpenLayers 3 xyz layer problem

I'm going to host a customized xyz tiled layer so I tested on my local machine to add that layer to OpenLayers Map control. I've already rendered some tiles using generate_tiles.py and Mapnik. I've ...
2
votes
0answers
785 views

How to check if a polygon contains another polygon in OL3?

Is there any possibility to check if a polygon is contained in another polygon in OL3? I noticed there is a couple of methods in ol.extent e.g. ol.extent.containsExtent(extent1, extent2). But this ...
2
votes
0answers
184 views

OpenLayers 3 don't go beyond given coordinates

In Openlayers 3 Max Extent there is mentioned how to set a max extent. But how can I set coordinates in such a way that it is not possible to drag the map beyond the some given coordinates? Extent ...
2
votes
0answers
558 views

OpenLayers3 Draw Interaction and click event issues

I plotted a cluster layer within a proximity(polygon) using draw interaction.Clusters get plotted inside. But when i tried to put click events on cluster layer using map.forEachFeatureAtPixel , click ...
2
votes
0answers
1k views

OL3: Is there a getUrl function for ol.source.XYZ?

Problem: I am designing an ol3 plugin that needs to copy the URL parameter from ol.source.XYZ/ol.source.TileWMS to ol.layer.Tile on map initialization. TileWMS: As per the docs, this is easily done ...
2
votes
0answers
642 views

Stop pending tiles requests in Openlayers 3!

I have created a Main-map in OpenLayers 3 with a single layer. I use 'setUrl' to change the layers sourceUrl, when I want to change the map: this.mainMapLayer = new ol.layer.Tile({ source: new ol....
2
votes
0answers
451 views

How to adapt layerswitcher to include listboxs

For my project I needed something that allowed the user to change the application´s layers and the best solution I found was this one layer switcher since openlayers 3 does not support a layerswitcher ...
2
votes
0answers
258 views

Migrate FixedZoomLevels Layer OpenLayers 2.13.1 into OpenLayers 3

I have a following problem. I am not able to migrate existing custom Layer written for OL 2.13.1 into OL 3. I do not know how to reimplement the FixedZoomLevels properties. OL2 code: OpenLayers....
2
votes
0answers
209 views

What is the openlayer.js alternative of unloadinvisibletiles of leaflet.js

I am using OpenLayers with a tile server. I want to load maps while panning and destroy the loaded region when out of screen (alternative to unloadinvisibletiles of leaflet.js) How am I suppose to ...
2
votes
0answers
803 views

How do I display GroundOverlays in OpenLayers 3 (from a KML)?

The back-end I'm working with serves KMLs in the following format (data is stripped for confidentiality): <?xml ...> <kml ...> <Document> <open>1</open> ...
2
votes
0answers
2k views

Are there more events in OpenLayers 3, besides “moveend”?

I am building an API on top of OpenLayers 3. I can't display here the whole code for professional reasons. This is a bit how my classes look like. // external file xgis.js xgis = {}; // xgis.map ...
2
votes
0answers
326 views

Bing OpenLayers shows OK in QGIS and Composer preview, but is misaligned after exporting to PDF

I have QGIS 2.2 running on a Mac with iOS Maverick. I have prepared a map with layers with different CRS, including a Bing OpenLayers as base layer. The project has the 'On the fly coordinate ...
2
votes
0answers
343 views

How can I retrieve/query data from shapefile for forms/grid in website?

I've made a site using OpenLayers and GeoServer. Currently I'm serving WMS layers from GeoServer (shapefiles). I want to add in my site a search form that the user can search for data (which I have in ...
2
votes
0answers
319 views

How do you emulate a right click on a tablet/mobile device using OpenLayers?

I'm trying to make my OpenLayers mapping application work for mobile devices and one feature I haven't figured out how to emulate is the 'handleRightClicks' Control Click option. Anyone know how to ...
2
votes
1answer
972 views

Use a second canvas for drawing an animation in Openlayers

I want to implement an animation of flowing rivers on top of an Openlayers map. My doubts are if I simply should make a new canvas and position it on top of the map or if there is a more elegant way ...
1
vote
0answers
26 views

OpenLayers origin at top left of map

I have an OpenLayers map which uses an ImageLayer as the base layer and I want to create a custom projection so that (0, 0) is at the top left of the image rather than the bottom left. I tried setting ...
1
vote
0answers
53 views

Vector tiles and QGIS 3.14+

I'm using QGIS to produce a vector tile dataset for use with OpenLayers (as shown here). However, although the dataset produced can be opened in QGIS and it renders normally, when using it in ...
1
vote
1answer
32 views

Canvas wider than containing div (OpenLayers)

Map canvas is wider than the containing map div. Causes problems when zoom to extent etc. Using Angular Material Flex-Layout / OpenLayers 6. // css .mapContainer { height: 100%; padding: 16px; } ...
1
vote
0answers
35 views

Apply a dynamic style to a raster(GeoServer, OpenLayers)

I want to apply a dynamic style to a raster using either GeoServer or OpenLayers. I have found similar examples at OpenLayers plugins but these examples work on RGB images instead of the real values ...
1
vote
0answers
21 views

Attribute based styling in openlayers 6 cluster layer

I was looking around for information, but i don't really understant the method. I wouldn't like to add more layers with the same name, because of the layerswitcher. I would like to switch to attribute ...
1
vote
0answers
41 views

Where I should add cql_filter param in WMTS layers by OpenLayers v6?

I am going to use cql_filter in wmts layers,this is my code, I read OpenLayers v6 Document , but I couldn't find params, I googled but I could'nt find any soltion, about cql_filter in WMTS Layers, If ...
1
vote
1answer
25 views

OpenLayers pass character parameters problem

I want send character parameter ('GREEN') to GeoServer as following: var untiled = new ol.layer.Image({ source: new ol.source.ImageWMS({ ratio: 1, url: 'http://localhost:8080/geoserver/...
1
vote
0answers
27 views

How to fix text position when horizontal line is on the left side?

We use Vue.js with OpenLayers 4.6.5. The issue looks like the following: How does it work? The user draws the first line, for example, from the bottom upward and makes a click to finish the first ...
1
vote
0answers
33 views

OpenLayers transform

My script: <script src="https://unpkg.com/openlayers@4.4.2"></script> <script> var ETRS89Extent = [5.93, 34.76, 18.99, 47.1]; proj4.defs('EPSG:6706', '+...
1
vote
0answers
29 views

Fixing OpenLayers Popup position in RTL pages

I'm using OpenLayers V6 popup but It has wired behavior in Right-To-Left page, When I click on my feature my popup shift map to let and it will be appear in right page! But in LTR page It work fine ...
1
vote
1answer
40 views

Export map in OpenLayers with toJPEG

Recently, we set up a web app with OpenLayers that allows exporting a map as a jpeg image. The map contains XYZ, WMS and/or WFS layers. We used the toJpeg function of the html-to-image library, as it ...
1
vote
0answers
28 views

How to add image in OSM with the authorisation key using OpenLayers

I am trying to get a layer from the WMS request but the problem is the URL expects the authorization header. I have tried implementing that I am getting the error. Failed to execute 'createObjectURL' ...
1
vote
0answers
42 views

Verify if a WMS layer exists or not in GeoServer (OpenLayers3)

WMSsource = new ol.layer.Image({ source: new ol.source.ImageWMS({ url: 'http://localhost:8080/geoserver/alger_data/wms', params: { 'LAYERS': 'alger_data:hotel' }...
1
vote
1answer
29 views

How to update my map with the restored features from JSON format?

I'm trying to implement a CRUD that have a map OpenLayers. First, I drawed and saved the features with writeFeatures(). Second, I'm trying to show the polygon that I drawed, and here is my problem: ...
1
vote
0answers
39 views

Is there a way to create Geospatial PDF with OpenLayers

I have a map and some layer and I want to export it in Geospatial PDF. I'm able to export it to a PDF document with jspdf just like the ol example (https://openlayers.org/en/latest/examples/export-pdf....
1
vote
0answers
39 views

Removing multiple layers in OpenLayers

I have created a project where I need to add and remove multiple layers in OpenLayers. The layers are from shapefiles that are available on a node server. I loop trough a list of all the names of the ...

1 2
3
4 5
15