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
1answer
9 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
19 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....
5
votes
5answers
2k views

Openlayers HiDPI/Retina Screen with standard resolution raster tiles?

My Openlayers application can display tiled rasters from arbitrary online sources. It will parse capabilities from any user-specified URL for WMTS, TMS, OSM, XYZ or WMS services and present the user ...
0
votes
1answer
186 views

Snap to shapes Google Maps

I wish to add snap to shape feature of openlayers shown here Snap Interaction to Google Maps drawing Library. Is there a way that this can be achieved. Here is the bare bone code of the Google Maps ...
0
votes
1answer
48 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
93 views

Putting a Mapbox-GL canvas into an OpenLayers node results in the Mapbox canvas being slim

I follow this example but my canvas is slim. I set a breakpoint here. const mbMap = new mapboxgl.Map({ // the node has a clientWidth of 674px. container: node }) The canvas is 15px less wide. <...
1
vote
2answers
16 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 ...
0
votes
1answer
101 views

WFS layer from GeoServer with OL4 - String index out of range error

I need to load a WFS layer from GeoServer 2.8 to a web app using OpenLayers 4.6.5 and JQuery 2.2.3 so that I can use Select to highlight a feature on click. I can preview the line layer as a WMS with ...
1
vote
1answer
79 views

Stop event in OpenLayers3

I used the example of this website : http://openlayers.org/en/v3.8.2/examples/feature-animation.html for make an animation. I don't have problem for stopping the event with the function clearInterval(...
0
votes
1answer
44 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
1answer
17 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 ...
1
vote
0answers
22 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
287 views

OpenLayers WMTS reprojection

I have a WMTS service URL, which gives me three layers in projection - WGS84_Pseudo-Mercator (tileMatrixSet). It's very easy to add them using this guide -> https://openlayers.org/en/latest/examples/...
1
vote
2answers
145 views

OpenLayers doesn't display US Census-based GeoJSON Layer

I'm getting started with OpenLayers and all was going well until I tried to use my own GeoJSON file. I started with the Cartographic Boundary Shapefiles - Counties from the Census website, loaded it ...
1
vote
1answer
32 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
48 views

Custom tile map not displayed correctly

I am using a XYZ layer to display the custom tile map generated from gdal2tiles, I have set a tile grid like below: //width =1065, height =950 this.extent = [0.0, -this.imgHeight, this.imgWidth, 0]...
0
votes
1answer
613 views

Point Buffer Creation in ol3

i saw your code to create a buffer around a point. on the link: How to add a buffer on a point in OpenLayers 3 in following code.. var pointFeature = new ol.Feature( new ol.geom.Point([0,0]) ); How ...
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
60 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 ...
0
votes
1answer
19 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
vote
0answers
38 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 ...
0
votes
1answer
87 views

Can't update map after first layer deletion on OpenLayers 6

So, I have a set of roads that have two configurations, a straight line, and a "snap to road" line, where the user can change between them by clicking the road icon on the toolbar. In order ...
0
votes
1answer
896 views

Draw polygon on load not working - OpenLayers

The following code should have 3 features: Draw a polygon on load On draw end send coordinates On modify end send coordinates 2&3 work as expected. I added the drawn polygon last, there is no ...
-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 ...
4
votes
3answers
5k views

Problem in displaying tile images using OpenLayers 3

I have problem with displaying my TMS layer using OpenLayers 3 (OL3). This is my first time working with tile images this way so maybe it doesn't have to do anything with OL3, maybe I just don't ...
2
votes
1answer
39 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
75 views

Color points based on values in OpenLayers 6

I'm trying to color points based on a value called 'ML_ABSOLUTE_VALUE', in a GeoJSON dataset but I can't get it to work. Here is what I have set up so far: Create the GeoJSON data source: const ...
1
vote
1answer
118 views

Openlayers overview map interferes with loading

I'm using Openlayers 3.16.0 and this bug has really stumped me. Whenever I turn on my overview map layers start loading more slowly and after a while just not anymore at all. Like this: Is this an ...
0
votes
1answer
29 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 ...
2
votes
1answer
40 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 ...
4
votes
3answers
4k views

Import from in Openlayers

I'm looking for some examples in OpenLayers to add in my project, and all those examples had something like this in their JavaScript:` import Map from 'ol/Map.js'; import Overlay from 'ol/...
0
votes
1answer
37 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
43 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
1answer
133 views

How do I transform custom coordinates to pixel in vector layer in OpenLayers 6

I have a XYZ layer for tiles(generated from an 1065 * 950 Image using gdal2tiles), and a vector layer for features, I want to use my own pixel transformation to set the coordinates of the features. ...
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 ...
2
votes
2answers
444 views

Generate WFS-T insert and delete requests using wfs-t openlayers3

I am trying to insert feature like point, line, etc on "india_ds" wfs layer map using wfs-t but not able to make successful POST request using openlayers3. I have post my script and error. I have ...
3
votes
1answer
212 views

qgis2web - show specific layers in layer list

Is there a way to display specific layers in layer list when exporting map with qgis2web plugin? I have created a map with bunch of layers like roads, names of places, rivers etc. but i don't want ...
0
votes
1answer
907 views

Openlayers coordinates changed to and from PostGIS

I am using PostgreSQL 9.5.9, PostGIS 2.3.2, Openlayers 4.1.0, Geoserver 2.12.0. I am trying to save a polygon that was drawn in Openlayers into my PostGIS database, and then display that same polygon ...
0
votes
0answers
31 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
28 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 ...
0
votes
1answer
2k views

Using OpenLayers for projection of static image on worldmap?

Using the latest OpenLayers, I'm trying to overlay a simple static image over the regular OSM streetmap. Although there are examples how to overlay an simple static image which is in the same ...
1
vote
1answer
113 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 ...
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
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() ...
0
votes
2answers
202 views

OpenLayers SRS in request

I have a layer in GeoServer and its projection is EPSG:27700. When I query the layer in my app I get and error. Explanation: The GeoServer preview displays it correctly. So I copy the JavaScript ...
3
votes
1answer
203 views

Programatically Cache WMTS for Offline Use

Background I have developed an app for iOS using the Swift language. The app uses online map services, including WMTS, WMS, TMS, XYZ and makes heavy use of OpenLayers to display these. I would like ...
-1
votes
0answers
16 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 ...
2
votes
1answer
246 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 ...

1
2 3 4 5
63