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

Obtaining coordinates from a Line at X distance

I'm working on a small personal project using GeoServer and OpenLayers. At the moment I have various LineStrings/MultiLineStrings that represent the roads of a city. I want to know if I'd be able to ...
0
votes
0answers
19 views

Create an OpenLayers layer using GetCapabilities info in JSON format

There is an example on how to create WMTS layer using GetCapabilities info. However I do not find how to create layers from GetCapabilities info which is in JSON format. OpenLayers API does not seem ...
0
votes
0answers
28 views

Show map tiles made in MapTiler in OpenLayers?

I converted GeoTIFF to png-tiles using MapTiler. Here is the folder structure: Now I'm trying to add this folder with png-tiles to OpenLayers as XYZ source: var layer = new ol.layer.Tile({ ...
0
votes
0answers
15 views

OpenLayers/Angular; feature properties not updating

I have a selection interaction that gets features when clicked. When it's clicked, I change a property to "true" in the feature. If this property is "true" a panel in a mat-...
0
votes
0answers
24 views

OpenLayers 4 static new layers disappear when changing projection from Mercator to Ortho

Hi have a map showing vector layers with a projection WGS84 (EPSG:4326) (it is online at this link, so you can test it). By clicking the button "Projection" (right side of the screen) a new ...
0
votes
0answers
34 views

OpenLayers OverviewMap control?

I want to change the overview map position to left side of the collapse listener.I am getting the map like as below image.I need map in black box. const overviewMapControl = new OverviewMap({ // ...
0
votes
1answer
31 views

Offset raster layer with ArcGIS source in OpenLayers?

In my case there are two layers: raster from ArcGIS REST service (red) and vector in MVT format (blue) The problem is that the raster layer is offset from the vector layer. It is assumed that the ...
0
votes
0answers
20 views

Customize contents of OpenLayers map attribution

I'm trying to build my own map attribution function and I want to see inside it a specific content. function MapAttribution() { const attribution = new ol.control.Attribution({ className: 'ol-...
0
votes
0answers
23 views

Stop/prevent showing context menu in OpenLayers 3

I am trying to make the context menu in a way that I can control where to show and where not to show. The summary is like I should be able to enable and disable the context menu in OpenLayers 3. I am ...
0
votes
0answers
20 views

Move point one meter to the right

I have a feature with a point geometry at position x,y on a map with projection EPSG:900913. I want to move the point 1 meter to the right. function movePoint(coordinate) { let point = new ol.geom....
0
votes
0answers
14 views

Prevent interaction to make use of non-Polygons

How do I customize an interaction (for example ol.interaction.Modify) in order to prevent Point and LineString Geometries to be interacted with? let interaction = new ol.interaction.Modify({ ...
0
votes
0answers
20 views

Beautify display of feature in console

When I log a feature in my browser's console in order to get an overview of it, the feature is displayed in a hard-to-read format. What is the reason behinde that? And can I beautify this somehow to ...
0
votes
1answer
30 views

Style Icon with fixed size

I try to style a point geometry feature like this, expexting it to have a 14px x 14px size. However, the feature is not displayed at all. When I remove the size parameter, the icon is displayed in its ...
0
votes
0answers
21 views

Resizing polygon in OpenLayers

How can I resize a Polygon? I want the user to enable enlarging a polygon by clicking on it, is there a native way to achieve that?
0
votes
0answers
19 views

Unable to trigger event of components on map OpenLayers

I'm new to Openlayers, currently have a ReactJS project that used OpenLayers for displaying maps. When users are in the map component, They can click on any address (coordinate) in the map to fetch ...
1
vote
1answer
41 views

Transform coordinate to whole circle's area OpenLayers

I'm new to OpenLayers and currently have a project that used OpenLayers for displaying maps. When I click on any address in the map, one circle will be drawn based on the address (coordinate). My ...
1
vote
0answers
49 views

Different calculation results of an area between OpenLayers and PostGIS [closed]

In OpenLayers I draw a 5 meter * 5 meter rectangle. If I calculate the area of the geometry in OpenLayers I get 25 m^2. But in PostGIS I'm getting 25.04. I need to get the same result. OpenLayers: ...
0
votes
0answers
28 views

Base Map for openLayers 6 with BNG EPSG:27700

Which base Map can I use in OpenLayers 6 with the British National Grid EPSG:27700 coordinate system? I am new to OpenLayers and trying to follow examples available using JavaScript on a local ...
0
votes
1answer
59 views

WMTS layer from GetCapabilities does not work in OpenLayers

I am trying to create functionality where I consume GetCapabilities data from several services and use that data to create layers with OpenLayers 6. However some GetCapabilities work and some don't. &...
4
votes
1answer
40 views

Add multiple vector sources in vector layer

I want to add multiple vector source to single vector layer. For adding single vector source to vector layer I am using below code and its working perfectly fine: const vectorSource1 = new ...
0
votes
1answer
14 views

OpenLayers3 getting a type error when trying to save mouse position to variable

In OpenLayers3 it shall be possible to save the current mouse position coordinates in a variable like this: map.on('click', function(evt){ let coordinates = ol.proj.transform(evt....
0
votes
0answers
29 views

OS Maps API – WMTS map (EPSG:27700), Point and Route layers fail to draw

Can anyone help a Nube? I'm learning OpenLayers using OS Maps. I am using WMTS(EPSG:27700) projection. The OS map displays, however, point and route layers do not, although I have successfully got ...
0
votes
0answers
28 views

Using EPSG:27700 Projection with OpenLayers 6

I want to use OpenLayers to use it with GeoJson Vector layers from MSSQL Spatil Table which have projection of UK coordinates BNG based on Easting Northing. Also which basemap can i use if not ...
0
votes
0answers
31 views

OpenLayers MousepositionControl in decimal degree

In my webgis application, we are using OpenLayers 6 with projection 'EPSG:32643'. I'm using mouse position control to show the mouse position on the map. I want to display the mouseposition in ...
0
votes
1answer
56 views

Change the style of a vector layer in OpenLayers

I have a list of layers drawn on the map with their geometry and other data. I want to change the style of those point whenever I click the name om the left. I have the event but I dont know how to ...
0
votes
0answers
39 views

OpenLayers 6.9: Cannot load Yandex Map

I tried to load Yandex map using OpenLayers library 6.9 and it's not working. A part of code for that is: var yandexLayer = new ol.layer.Group({ layers: [ new ol.layer....
0
votes
1answer
43 views

Difference between Image layer and Tile Layer

what is the basic difference between Image Layer and Tile Layer? Apart from the documentation....which says below points ol/layer/Tile - Renders sources that provide tiled images in grids that are ...
1
vote
1answer
35 views

Uncaught Error: Unsupported GeoJSON type: undefined - Openlayers

I get a valid geojson from the database using a query. Below one is the php script used to read the data. <?php include "../includes/init.php"; // including data base connection $sql = &...
0
votes
0answers
53 views

AJAX Request (Point Feature, Format GML) with fetch API from WFS failed

I work with OpenLayers 6.9.0. Individual polygon and point features are displayed on the map with a GetFeature request via WFS. The WFS delivers GML, no GeoJSON. Points and polygons come from the same ...
0
votes
1answer
27 views

How to export map OpenLayers from selected position

I an using the example op OpenLayers map export example. But I want to change start of mapContext.drawImage(canvas, 0, 0); method. Array.prototype.forEach.call( document.querySelectorAll('.ol-layer ...
1
vote
0answers
43 views

OpenLayers shows features at displaced location

I am having an OpenLayers 6.9.0 map within a vue.js application. The issue I am experiencing is, that features displayed on the map will be shown at a different location after panning or zooming into ...
0
votes
0answers
33 views

How can I get the canvas of map object?

I have an angular component in my application. export class MyComponent implements OnInit { isActive: boolean = false; constructor(private mapComponent: MapComponent) { } do(){ console....
0
votes
0answers
27 views

How to prevent cluster shows a different value than I have

I have created vectors using as source WFS but when I zoomin/zoomout/movemap number on vector(length) changes as I have more vectors but I don't. I had another cluster for more vectors so I thought ...
3
votes
1answer
76 views

Creating heatmap from vector tiles using OpenLayers

I know that is possible to make a heatmap using ol/layer/Heatmap, but this component accept as source only ol/source/Vector component. Someone have build a heatmap using VectorTile as source? Can you ...
0
votes
0answers
41 views

Adding new view to OpenLayers map

I am adding new views for my map with a switcher from https://wiki.openstreetmap.org/wiki/Tile_servers Dark ("Dark Matter") to be exactly. as attribution is needed i am import from OSM but ...
1
vote
1answer
52 views

DragRotate Interaction Distorts GeoTIFF OpenLayers 6.9.0 [closed]

Context I have some GeoTIFF files that are loaded directly into OpenLayers via a WebGLTile Layer with a GeoTIFF source. My code is similar to the example in this workshop. I am also registering a non-...
0
votes
0answers
20 views

Adding custom angular component as control in OpenLayers map

I want to add my own component as a zoom control for an OpenLayers map. From here I see that I can do that easily if I create some html elements. But I already have this zoom component that I use ...
0
votes
1answer
108 views

Displaying GeoServer Mapbox Vector Tiles with a custom Gridset

I'm trying to render Mapbox Vector Tiles hosted on a GeoServer instance. I followed along with the GeoServer Vector tiles tutorial without any issues (the demo uses EPSG:900913). Likewise, I'm able to ...
0
votes
0answers
36 views

404 on a getfeatureinfo request from GeoServer

I am trying to make a getfeatureinfo wms-request in GeoServer for a OL map. This is done with a proxy. Everything seems to be going fine but the place where the Information should show up it just ...
0
votes
1answer
26 views

Creating .webp stores in GeoServer

Using GeoServer, is there a way to convert my existing GeoTIFF raster data sources into a WebP format? My goal is to render these WebP formatted layers on a OpenLayers map. The GeoTIFF layers render ...
0
votes
0answers
37 views

Change/update tile WMS layer source with new parameters in OpenLayers

I have a WMS in JavaScript created with GeoServer and OpenLayers. I want to dynamically update the map parameters, for example depending on the chosen year the map should show the data from that ...
0
votes
0answers
40 views

Only one image is showing up on OpenLayers map

I can only get one of the following DEM_image PNGs to show up on my map. Its always the first one "DSS.layer.DEM.image0" that shows up, the rest do not render. I can see in the console ...
0
votes
2answers
26 views

Fetch all values from all granules of an ImageMosaic click event

I have sucessfully implemented a time series for an ImageMosaic in OpenLayers, using Geoserver as my processing tool. Additionally, I have implemented an onClick event to fetch values when a user ...
2
votes
1answer
101 views

Dividing polygon into given number of equal areas in OpenLayers

I'm using a Style with Stroke and Fill to have something like this for Polygon: const feature = new Feature( new Polygon([ xPos.map((x, index) => { return transform([...
1
vote
0answers
46 views

Web console result is not comprehensible when switched to new OpenLayers library

I'm using this library https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v6.4.3/build/ol.js initially and I was getting result in web console (ref below image) However, when I started ...
0
votes
0answers
41 views

OS Grid reference control clash with version 6.3.1

I would like to implement the OS Grid reference control, which is here: http://eap.ucr.ac.cr/mapas/ol-ext-master/examples/canvas/map.control.gridreference.html I have modified the code for my needs, ...
1
vote
1answer
50 views

Extract coordinates from .gpx file with OpenLayers (or any other JS library)?

I have a simple drag and drop event assigned to my OpenLayers map. This allows me to take a .gpx file, drag & drop it on top of my map which results in the route being visualized on the map. The ...
0
votes
0answers
17 views

Render map to a hidden div

I want to display the results of a query on a map. I have a hidden div in which I am going to render the map that will be shown when I click on the button that executes the query. The problem is that ...
0
votes
0answers
18 views

t-rex vector tiles results in HTTP 204

I am trying to load vector tiles using t-rex server via Openlayers. I pass in my shapefile to test out the output "%programfiles%\t-rex\t_rex" serve --datasource D:\data\nyc_census_blocks....
0
votes
0answers
24 views

Can OpenLayers be used to show/edit electrical Single Line Diagram (SLD)

I have some spatial data source(SQL server tables with geometry fields) that contain spatial data for single line diagram or SLD(here does not stand for styled layer descriptor) of electrical networks....

1
2 3 4 5
66