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
10 views

Can OpenLayers display tiles from UK's Ordnance Survey [closed]

Does anyone have practical experience of using OpenLayers, together with tiles based on data from the UK's Ordnance Survey, without having to generate or host one's own tiles? If your answer is yes, ...
0
votes
0answers
26 views

Is project more Leaflet or OpenLayers or Map Server friendly? [duplicate]

I have several tables in a database on PostGIS. I want to create a website where the users can log-in, show the layers they want and filter the elements of the layers based on the fields of the ...
0
votes
0answers
16 views

Parsing shapefile and showing features on map [closed]

I would like to read shapefile then parse it and add features from files to map. Does anyone solve that kind of issue? I need some suggestions. For parsing, I have used the shapefile library, it ...
0
votes
1answer
27 views

How can I show map from GeoServer using JavaScript on my web with base map OpenLayers? [closed]

http://localhost:8080/geoserver/flood/wms?service=WMS&version=1.1.0&request=GetMap&layers=flood%3Apak_water_areas_dcw&bbox=61.2723655700684%2C23.694694519043%2C75.8473587036133%2C36....
1
vote
0answers
13 views

Displaying Vectortile Source using ngx-openlayers

I downloaded a tileset from OpenMapTiles and host it with tileserver-gl, what is working just fine. Now I want to load and display the vector tiles in an Angular 7 application using ngx-openlayers, ...
1
vote
1answer
52 views

WFS point layer does not appear on OpenLayers map when called from GeoServer

I'm writing because I attempted almost all the tries suggested in any other Q/A on this thread. I have this vector points layer on my local GeoServer and i'm trying to plot my points on a OSM base map ...
1
vote
1answer
18 views

OpenLayers select.on event listener fires multiple times (renders multiple)

I am using hook React My question is to render event only once instead multiple times useless When I am selecting a feature, it renders multiple times var select = new ol.interaction.Select(); ...
0
votes
0answers
24 views

WFS visualization is different OpenLayers and QGis [closed]

I am trying to visualize a WFS source on openlayers but its different from QGis. Screenshots are here:
1
vote
1answer
31 views

Unable to delete 3rd vertex of a polygon | OpenLayers6

When polygon has 3 vertices left I am unable to delete any of those vertices: var modifyInteraction = new ol.interaction.Modify({ features: selectCtrl.getFeatures(), deleteCondition: function(...
1
vote
1answer
37 views

Can't use Raster with vector layer

I'm trying to clip a raster layer with a vector layer, but openlayers seems to fail when it tries to call getImage on the vector layer? What am I doing wrong? proj4.defs('EPSG:3006', '+proj=utm +...
2
votes
1answer
34 views

How to select feature first and then start the zoom animation

I'm trying to select a feature first and then start the zoom animation but openlayers (v6) first start the zoom animation and when it's done the feature gets selected, what's going on here? Here is ...
-1
votes
1answer
27 views

Autocomplete/intellisense OpenLayers in Visual Studio [closed]

How can I enable autocomplete in Visual Studio Code when using OpenLayers?
1
vote
1answer
53 views

How to select only specific features not all, and how to drag drop correctly [closed]

First issue: I would like to select only a few features and not select rest Let imagine I have 5 features in below code you will see that I can select all of them. Second issue The second issue is ...
-1
votes
0answers
51 views

How to getFeatures from GeoJSON? [closed]

I have a problem using .getFeatures (); I found that it didn't send anything at all. I also use the check method. console.log (features); If any errors please tell me var layer_source = new ...
1
vote
0answers
35 views

Openlayers 6, App crashes when I set too many text labels

I'm looking for an efficient way to set conditionally text for over 3000 features. Below is a little code on how I do it now, but my Android App freezes and crashes sometimes because it exceeds the ...
1
vote
1answer
33 views

OpenLayers - remove all layers of map apart from base map layer?

What i need is to delete all layers from the map without removing the base one (in my case OSM) Here is some code new Map({ layers: [ new TileLayer({ source: new OSM() }) // <== ...
1
vote
0answers
69 views

Is it possible to zoom to custom map center with Zoom Controls?

The OpenLayers example Advanced View Positioning shows how to create a “view inside a view”. If you examine the example, it uses a padding passed to view.fit(), from which you can correctly zoom to ...
1
vote
1answer
31 views

Openlayers: Using PHP and npm

I've got a rather large MySQL database containing polygons (coordinates) and their additional properties (e. g. text labels in different languages). I would like to use PHP to connect to my database ...
2
votes
0answers
40 views

Select GeoServer vector tiles feature using OpenLayers and show features attribute in popup?

I have installed vector tiles extension in GeoServer and published a PostGIS tables using this format. The requested vector tiles from GeoServer using Openlayers works fine. Now, I want to select and ...
0
votes
0answers
33 views

GeoServer with SQL Table having lat/long

I have a table in SQL Server with geometry column. I save geometry like : geometry::Point(@Lat, @Long, 4326)and this results the geometry for the given lat/long. Now when I publish this layer in ...
1
vote
0answers
23 views

Openlayer 5.3 : select part of gpx/kml [closed]

I created a page where people can upload a gpx or kml file. Openlayers makes this a piece of cake. But now I would like to provide some kind of editing to select a piece of the multilinestring. What ...
0
votes
0answers
37 views

Change the Color of the road dynamically

I want to use openstreet map in openlayers and i want to be able to change the color of the road dynamically. Example: Change it to red, green or yellow dynamically or depending on a value. How do i ...
2
votes
1answer
45 views

Resizing Map width and height (avoid distortion)

I am working with OpenLayers library on React My first question is how to avoid distortion while resizing map width and height, The second issue is when I am changing with/height each time it ...
0
votes
1answer
26 views

QGIS 2map plugin issue - no map tiles provided for QGIS 3x (3.8)

Following the example described here: https://www.qgistutorials.com/en/docs/web_mapping_with_qgis2web.html I am trying to do the same with QGIS 3.8. The process in QGIS is simple, after seeking the ...
1
vote
0answers
51 views

OpenLayers 6: GeoJSON polygons not displaying without any error [closed]

I have two GeoJSON files, the data should be Cartesian already. One GeoJSON (https://jsonblob.com/a4e3c8c9-0970-11ea-98b2-a57dd05dc415) file works fine but the polygons from the second one (https://...
1
vote
0answers
27 views

OpenLayers not adding map controls?

I'm trying to add default controls (zoom) to an OpenLayers map as following: this.map = new Map({ target: 'map', controls: defaultControls(), moveTolerance: 2, layers: [this.capaFondo, this....
0
votes
0answers
15 views

Map does not render completely (OpenLayers 6.1.1)

When I zoom in my map, these blank spaces (image below) appears and does not render sometimes. This problem appeared when I updated OpenLayers from 5.3.3 to 6.1.1 Also: I'm using UTM SIRGAS 2000 ...
0
votes
0answers
15 views

Zoom Sliders not showing on OpenLayers?

I added a Zoom Slider to my map as following: this.map = new Map({ target: 'map', layers: [this.capaFondo, this.capaPropia, this.vector], view: new View({ projection: proyeccion, center:...
1
vote
1answer
34 views

How to select only one feature of a vector layer from a drop down list using OpenLayers?

I am working on a project using OpenLayers(v5.3.0) and javascript which displays a vector layer. Using a dropdown list , vector layer features can be selected. Now the project works like, when I ...
0
votes
0answers
21 views

Icon position is moving by map move and zoom

The last hurdle to code a Leaflet in an OL ... OL v6.1.0 (Openlayers 6) Android 4.4.2 (KitKat) cyanogenmod 11 - default browser Simple example: Put an icon as a marker point in the map. That's not ...
1
vote
1answer
34 views

Using OpenLayers and JSTS to create buffer geometry

So far I have found similar questions like this one but none have quite expressed or fixed my exact issue. I'm using Openlayers v4.6.5 and JSTS 1.4.0 The problem I'm having is with the buffer() ...
1
vote
1answer
43 views

AssertionError 25 on getExtent, Openlayers?

When doing this.map.getView().fit(this.layer.getSource().getExtent()) with my vector layer I get an assertion error as following: AssertionError {code: 25, name: "AssertionError", message: "...
2
votes
0answers
36 views

Openlayers-6 .fit(extent, {options}) not working with options

I have upgrade openlayers in IONIC V3 app from 4.6.5 to 6.1.0. Now map.getView().fit(extent, {duration:1000}) stop working, when i remove the options object it works fine. Am i doing something wrong ...
2
votes
1answer
24 views

Triggering built-in events programatically OpenLayers

Is there a way to trigger openlayers event from console. In this case: ol.interaction.Select event which listens 'select' (ol.SelectEvent.select). It triggers when feature is selected or deselected ...
2
votes
1answer
28 views

GeoServer, OpenLayers, Tomcat,

Access to XMLHttpRequest at 'http://localhost:8080/geoserver/decuong_doan/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=...
1
vote
1answer
28 views

OpenLayers get closest feature over multiple vector layers

My OpenLayers map has multiple, vector layers, each with unique features. I need a way to find the closest feature to a location across all the layers, in the same way that ...
1
vote
1answer
25 views

Advance text style of feature in openlayers

Is there any way to create table or any html element in text style for features? i tried other ways like putting overlay on feature then in overlay i used table and html elements but had some problems ...
0
votes
0answers
16 views

Align layers with different tileGrid in OpenLayers3+

How to align two layers who have different resolutions in new ol.tilegrid.TileGrid({ ... resolutions: ... }); Both layers have same extent and tile size.
0
votes
0answers
17 views

Replacement for OpenLayers.Control.Snapping.addTargetLayer in OpenLayers 3+?

I am upgrading OpenLayers version from v2 to 6 and did not find a replacement for OpenLayers.Control.Snapping.addTargetLayer
0
votes
0answers
12 views

Redo last drawn point in OpenLayers 3+?

ol.interaction.Draw has removeLastPoint but I could not find "redo" function. Does one exist?
1
vote
1answer
40 views

OpenLayers 6.0.1 set custom center after load map

I am using OpenLayers 6.0.1 web map. I have plot a new marker on map with custom image and want to put the map to be centered newly plotted marker position.
0
votes
0answers
26 views

Calculate histogram from raster stored in GeoServer

I have a raster stored in GeoServer which I can show it with Openlayers in my web page: raster = new TileLayer({ source: new TileWMS({ url: 'http://myip/geoserver/myworkspace/wms', params: {...
1
vote
2answers
36 views

How to reverse / invert / switch X and Y coordinates in OpenLayers 3+?

In OpenLayers 2 you could pass additional paramater for layer options to reverse X and Y coordinates order in BBOX parameter for WMS GetMap request. var layerOptions = { ... yx: {'EPSG:3346' :...
1
vote
0answers
21 views

Zoom to extent using geom or xmax, ymax?

I made a function to zoom to polygon geom if I click the button. This is my script: $.ajax({ type: "POST", url: 'core/zoomtolocation', data: { ...
1
vote
0answers
24 views

Get all displayed layers currently visible in the map

Angular: 8 Openlayers: 5.2 I am trying to build a dynamic legend that only shows the displayed layers in the map. With a getLegendGraph from mapserver I want to create the legend. This works great ...
2
votes
2answers
50 views

Converting GeoJSON to projected coordinates in Leaflet?

We are migrating existing angular app from OL to Leaflet. In OL we were able to get the geoJSON in UTM with EPSG:3857 on draw finish However when we complete a draw in leaflet and try to get the ...
2
votes
1answer
35 views

Layer displaying correctly with OpenLayers and GeoServer as WMS but giving CORS error when trying to display the same layer as WFS

I have the following map which works perfectly: import 'ol/ol.css'; import {Map, View} from 'ol'; import TileLayer from 'ol/layer/Tile'; import TileWMS from 'ol/source/TileWMS'; import BingMaps from '...
1
vote
0answers
27 views

Kinetic properties in OpenLayers 6

I'd like to know how to adjust properties of ol/Kinetic. And also, what are the default properties when using the default ol/interaction/DragRotateAndZoom ? Properties are decay, minVelocity and ...
1
vote
0answers
30 views

OpenLayers: disable selection from label of feature

I have a feature with a circle and a text attribute. The text attribute is displayed via a text-style above the circle center. The current behavior: I can select feature from text style label. The ...
2
votes
2answers
43 views

WFS from GeoServer on OpenLayers doesn't work

I'm trying to create participatory map but I can't basically insert a WFS into my OpenLayers frame. I searched for a lot of different solutions. My WFS does work into QGIS, I also can insert WMS into ...