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
1
vote
1answer
15 views

Updating the TEXT attribute on an OpenLayers point

I have the following map and vector layer declaration that is working: var map; var vectorLayer = new ol.layer.Vector({ target: "points", source: new ol.source.Vector(), ...
0
votes
1answer
41 views

Setting circle radiuses from GeoJSON in OpenLayers style and style function

I'm trying to set the radius of points coming from a GeoJSON in OpenLayers. I was successful integrating the style in the style function like in this question. However, for performance reason, I now ...
-2
votes
0answers
37 views

How to understand POLYGON coordinates data

I am very new in this area. Just trying to build an APP. But very confused yet. Using OpenLayers to render a map and draw some shapes on that. Provided data I am receiving is not descriptive there is ...
1
vote
0answers
29 views

OpenLayers zoom to point with padding

In my web app I have a search side bar which can return results as either a bounding box, or an X and Y coordinate with a zoom level. The sidebar pops out the side of the screen and partially overlays ...
0
votes
1answer
30 views

Not getting property added through WFS

I am trying to insert properties in shapefile using Openlayer and WFS layer. I wrote my code and I believe it is correct because in response I am getting <?xml version="1.0" encoding=&...
1
vote
1answer
31 views

How can I add properties in WFS layer using OL

Is there any way I can write in shapefile. As per my knowledge if I load the WFS layer in QGIS and if I have write permission in that layer then I can write in shapefile. Can I add properties in the ...
0
votes
1answer
14 views

How to calc area using OpenLayers with UTM coordinates

I just need had a point format like below (zone,x,y) and need to calculate it's Area. 39,553816,3791942 39,548052,3731376 39,637947,3711980 39,616343,3808591
1
vote
1answer
21 views

How to get layer from modify event of insertVertexCondition method?

For my dev, I want to get the text of the current selected layer from event of modify interaction. Below is the code snippet I used, but I can't get text of layer. var modify = new ol.interaction....
1
vote
2answers
19 views

Getting the nearest point while ignoring polygon in OpenLayers 6

I have a map that contains one single layer with multiple feature. Those feature contains polygon and point. I do not filter them because I did load every layout in the same object like the following ...
1
vote
1answer
19 views

Showing the current location in ionic with OpenLayers

I try to show a road in a map + I want the user to be able to see himself on the map. I have the following constructor(){ this.initUserPosition() } init(target = 'myMapid', zoom: number) { private ...
0
votes
1answer
50 views

Panning & Zooming do not work when a vector layer feature fills the entire map

I can't seem to find a solution to allow panning or zooming when a vector layer polygon fills the entire map area. My current solution is to use the zoom out button to zoom out far enough to find an ...
0
votes
1answer
48 views

Corporate logo added to openlayer web mab created with Qgis2web

I have used the advice from a similar post: <body> <h1>Megacorp Industries</h1> <div id="map"> </div> This works to put in a title at the top but it ...
1
vote
0answers
29 views

OpenLayers icon interaction: feature.get(…).getImage is not a function

I try to add a hover and click interaction to the points (displayed as marker icons) I show in my map. I want to display a border around the icon that is selected/hovered. I started by using the ...
1
vote
1answer
34 views

OpenLayers: How to shift zoom level content for ol/sourceXYZ about one zoom level

The Swisstopo WMTS service assigns specific raster map content to specific zoom levels: .... 16: 1:25'000 Raster map 15: 1:50'000 Raster map 14: 1:100'000 Raster map .... Here is a code example. ...
0
votes
1answer
23 views

Allowing non-schema values during WFT transaction between OpenLayers and GeoServer

I have a function that manage WFS-T Transaction between a web application client (based on OpenLayers 6) and a GeoServer instance. import axios from "axios"; import { WFS } from "ol/...
0
votes
1answer
20 views

How to get EPSG:4326 coordinates on Drag and drop in OpenLayers

I followed the example on how to implement a drag and drop interaction with openLayers. I now want to read the coordinate of every features like the following this.dragAndDropInteraction.on('...
-1
votes
0answers
22 views

Visualization solution for 2M points with elevation attribute

We have almost 2 million discrete points each contains the geometry position and the elevation of the that. These points cover about area of 100,000 km². Now we want to do some visualization for the ...
2
votes
1answer
43 views

OpenLayers custom tileGrid for scanned map image - How to calculate resolutions?

I'm using OpenLayers 3 and attempting to display a layer based on a custom tile grid in a custom projection (EPSG:4202) on a standard projection map (EPSG:3785). The layer is essentially a photo of a ...
0
votes
1answer
35 views

Vector Tiles Projection - PostgreSQL/GeoServer/OpenLayers(Mapbox GL)

I have a dataset in PostgreSQL that is in EPSG:27700, this is read by GoeServer and converted to .pbf files (using GeoWebCache). I have tile gridsets enabled for ESPG:27700,ESPG:4326,ESPG:900913. I am ...
1
vote
0answers
40 views

Showing measurement in OpenLayers 6 while modifying

I have this code. I create class the name is MeasurementClass. this class used for overlays component creator, setting of html and configure style . this class can handle it. class ...
2
votes
1answer
41 views

Loading big GeoJSON polygon data from GeoServer using OpenLayer bbox loading strategy

This is my project as beginner to learn how to use OpenLayers and GeoServer. I'm using GeoServer version 2.19.0 to share my shapefile with so many polygon in it. Using EPSG:4326 as the projection, I ...
1
vote
1answer
44 views

How to add Marker on map click using OpenLayers 6?

I want to implement adding icon/marker on map click. It should work like this (Leaflet example). https://codesandbox.io/s/add-onclick-on-mapcontainer-in-react-leaflet-v-3x-4r7tc I am using OpenLayers ...
0
votes
0answers
32 views

Styling GeoJSON with a styleFunction

I've problems symbolizing the result of a GeoJSON. I do the function and define the intervals based on the results of the GeoJSON. I want to symbolize the abundance field. I put a part of the GeoJSON, ...
0
votes
0answers
29 views

Removing layers from OpenLayers not working after layers are drawn

I have a simple map application written with Angular and Node.js There is search service that works fine and shows the results with geometry. After the search results I draw each result on map So far ...
1
vote
1answer
123 views

Unexpected token < in JSON at position 0

According to Google, this error seems to happen quite often, and now it happens to me. I read lots of the posts I found, but unfortunately my error remains... I took a countries.json (I think from the ...
1
vote
1answer
50 views

OpenLayers Modify interaction on line - use different styles for “Move Vertex” and “Add Vertex”

I use OpenLayers 6.5 for my mapping application. With the Modify Interaction, it is possible to add or move vertices for a line layer. However, the symbol (circle) is the same whether the mouse is ...
0
votes
0answers
26 views

OpenLayers assertion error when styling the layer

I have the following code that get the search result and then lists the results that has geometry in it. findLocation(results: any) { results.map((res => { const format = new ol_format() ...
-1
votes
0answers
17 views

Build a web mapping secured platform with authentication module for editing layers [duplicate]

I would like to develop an Open Geospatial Data platform using Open Source tools. So far, I started with the data servers to import data layers (PostGreSQL-PostGIS / GeoServer) then I built an ...
1
vote
1answer
21 views

Remove features and dynamic vector layer from the map

Fixed the problem of showing or hiding the vector layer on the map after executing a query, I find that after a new search, the previous vector layer is not removed, it remains on the map. I tried to ...
0
votes
1answer
43 views

bringToFront() method equivalent in OpenLayers

Does OpenLayers have a method similar to bringToFront in Leaflet? In Leaflet this works as follows. If I have a layer called geometry this method will bring that layer to the top of the other layers ...
0
votes
1answer
39 views

Using the new OS Maps API (XYZ Version) and I keep getting 404

My request URL is this - https://api.os.uk/maps/raster/v1/zxy/Outdoor_3857/5/47/-765.png?key=apiKey I'm passing a valid API key, but all I'm getting is a 404. Any ideas on where the get further ...
1
vote
1answer
26 views

How to change label of rotation button in OpenLayers?

The documentation claims that "instead of text also an element (e.g. span) can be used": https://openlayers.org/en/latest/apidoc/module-ol_control_Rotate.html I tried this.olMap = new Map({ ...
1
vote
1answer
31 views

OpenLayers zoom on a collection of points

I'm new to OpenLayers, but I have a working map with 5 points based on GPS coords working. however, it's not zooming to the extents of the points. Wondering what I've done wrong (could very well be ...
0
votes
1answer
37 views

Group Layer with dynamic vector layers

Starting from the previous solution. Would it be possible to create a group with several dynamic vector layers? I tried to do it but it gives me an AssertionError when I create the group. function ...
0
votes
1answer
39 views

OpenLayers v6.5.0: How to create a non-intersecting polygon passing through all given points

Is there any function/library that I can use to create a non-intersecting polygon? Below is the code that I used to draw Polygon from the specified points but it is not working for the non-...
1
vote
1answer
44 views

How to add/remove Vector Layer from a Map

I have doubts about how to show or hide a vector layer on the map once I have created it. I generate it after doing a php query and receiving the data in json. This is the function that I use to send ...
0
votes
0answers
30 views

How do I add OpenLayers “overlays” using Vue.js

I can't figure out how to implement an OpenLayers "overlay" in my Vue.js app. There doesn't seem to be much guidance online about how to do this. The Vue component below gives me the map ...
1
vote
1answer
41 views

How to set different style and name for each feature individually OpenLayers

I am trying to style each feature with different style and set properties like name dynamically like in this but all features get the same style the code select.getFeatures().on(['add'], function (e) ...
1
vote
0answers
28 views

Add feature to an OpenLayers VectorTileSource

Is there any way I could add a Feature to an OpenLayers VectorTileSource? I know that the VectorSource has the method addFeatures() but not the VectorTileSource since it's of type MVT. What I need to ...
2
votes
1answer
41 views

OpenLayers : intersect between polygon and circle not accurate

When I look for intersect between circle and polygon. He finds intersect between these two, who are not visually intersected. Everything should have the same projection ('EPSG:3857'). But I don't know ...
0
votes
0answers
33 views

How to show the horizontal zoom slider on the top right of the map

The below posted code is to show a map with zoom bar or slider. The code is taken from here: https://openlayers.org/en/latest/examples/zoomslider.html I attempt to show the zoom slider number three, ...
0
votes
0answers
34 views

Getting next lat,lon on OL Map 3

I have the following 2 points on the map: point A lat1 / long1 and point B lat2 / long2 in OL map I have distance, arrived_time, speed. With these data how can I get a estimated latitude, longitude ...
1
vote
0answers
34 views

Show Label on Map in Open Layers

I am working on a process to show location on the map along with its label. I have figured out the way to show the marker location but not the but I cannot figure out the way to show the label. Here ...
0
votes
1answer
63 views

Getting GeoJSON file to load in OpenLayers

I have validated the JSON and I'm certain it is clean. I'm loading it from a web server (using Node.js). The Firefox error is "Uncaught SyntaxError: JSON.parse: unexpected character at line 1 ...
1
vote
0answers
12 views

OpenLayers: How to re-add a feature that draws line segments of a tracked route?

My app records tracks (e.g. a bike route). There is a start and a stop button, which start and stop the recording of such a track. After a recording has been stopped, the user can start a new ...
0
votes
0answers
45 views

How to add GeoServer Vector tiles in React using OpenLayers API?

We are creating a React application and we want to display vector tile layers from GeoServer. The basemap is required from ArcGIS REST service using the following code and it works properly const ...
0
votes
1answer
39 views

Using Fontawesome 5.7 icons with OpenLayers 3

I'd like to use this Fontawesome version with Openlayers 3. I tried changing the font value from FontAwesome to Font Awesome Free, but nothing happens. On the map appears a square (it means that the ...
1
vote
0answers
35 views

What controls the coordinate value in the singleclick MapBrowserEvent argument?

I am trying to understand what is affecting the "singleclick" callback argument: MapBrowserEvent in my OpenLayers map (v6.4.3). While I always receive the pixel coordinates back, I don't ...
0
votes
0answers
31 views

Point Layer is Not Show When 3D Mode is Active [Cesium, OLCS, Openlayers]

I have a 3D map build with Cesium + OLCS + Openlayers. But in one case i cannot show my WMS Image Point Layer when 3D mode is active like this: But Polygon Layer can show when 3D is active, and when ...
1
vote
1answer
29 views

Make rotate button always visible in OpenLayers

The documentation mentions that the rotate button is always hidden, when the rotation of the view is 0: https://openlayers.org/en/latest/apidoc/module-ol_control_Rotate-Rotate.html A .ol-hidden css ...

1
2 3 4 5
63