Questions tagged [openlayers]
OpenLayers is an open source Javascript web mapping library for creating web map applications.
4,799
questions
2
votes
1
answer
34
views
OpenLayers, clusters with touching polygons. How do I show them separately when zooming in?
Zooming in on clustered polygons that touch each other will not show the polygons.
I'm using OpenLayers 6 to show a number of suburb polygons. Clicking on the polygon will show some details about that ...
0
votes
1
answer
17
views
Openlayers Geotiff layer's getData returns Uint8 when source is float
I am trying to visualize a single band COG with OL and am loading the geotiff as:
const source = new ol.source.GeoTIFF({
sources: [
{
normalize: false,
// band 1 elevation
...
0
votes
0
answers
19
views
Uncaught TypeError: format.writeGeometry is not a function at HTMLButtonElement
I would like to create a GML using openlayers to send to Geoserver to insert a new feature. While displaying writeGeometry() in console it displays the error like: Uncaught TypeError: format....
0
votes
0
answers
41
views
Color palette issue when overlaying layers in OpenLayers
I'm trying to draw a temperature heatmap layer on top of the map. But here the problem arises that the heat map overlaps the names of cities, as in the first screen.
When adding opacity, the color ...
0
votes
0
answers
27
views
Openlayers Graticule current interval
How can I get the current interval value of Graticule on zoom change?
There are Meridians and Parallels of the lines, from where I can calculate the value, but this is not the right approach.
-1
votes
0
answers
48
views
Search multiple GeoJSON feature properties in OpenLayers?
I have a code to do search function. I want to search with shthua and shbando but something wrong in my function. I get a random result everytime I click on the button even without entering the value ...
-1
votes
0
answers
23
views
How to add interactions by coordinates in OpenLayers?
I am trying to draw interactions by using coordinates from database with fetch api.
How can i draw interactions ?
My fetch get code is in the map code
I am using javascript and openleyers. When i ...
0
votes
0
answers
26
views
OpenLayers: How to hover over a raster (GeoTIFF) layer and return pixel value
How can I create a tooltip or mouse-over hover to return real data pixel values from a raster GeoTIFF source in Open Layers?
Thanks.
0
votes
1
answer
45
views
Adding a Layer to OpenLayers map in React
I'm trying to add some functionality for adding layers onto an openlayers map which I've done before in vanilla js but am new to react and having an issue updating the map to display layers. I saw a ...
-1
votes
0
answers
23
views
OpenLayers map loses height and width
In my application I am using Open Layers 6.
The application utilizes some hiding and showing of DIV's the map div is one of these.
When I navigate away from the map DIV OpenLayers loses the height and ...
-1
votes
0
answers
31
views
Openlayers - Best way to assign a text to a feature?
I have multiple Features and I wanna assign to each a unique text whiche containes specific data about about the feautre, for example let's consider a feautre to be an arrow to represent wind ...
-1
votes
0
answers
26
views
Google Map and Mapbox android SDK performance in mobile is bad compared to openlayers running on mobile chrome
I ran into a performance issue with Google Maps SDK for android.
I had a feature collection of over ~700 points and ~1200 paths. And google maps on android lags a lot in basic zooming and panning.
I ...
-2
votes
0
answers
12
views
how to fix this problem : Access to XMLHttpRequest has been blocked by CORS policy [duplicate]
i want to add Attribute Query functionality in my Web Mapping Application so i add this code in my js file , when i execute it didn't work and it's give me the following error :
index.html:1 Access to ...
1
vote
1
answer
44
views
Using Openlayers ImageCanvas canvasFunction to draw over features from another source
I'm working on some custom drawing tools that will apply very specific styling most easily created and drawn directly to a canvas. I'm having a difficult time figuring out how to align coordinates to ...
0
votes
0
answers
31
views
Add tooltip on hover to node in OpenLayers
I have an OpenLayers map which people can draw and modify geometries on. For Polygons and LineStrings you are able to delete the individual nodes by holding down alt and clicking the node, but this is ...
1
vote
0
answers
55
views
Reloading WMTS layer in OpenLayers 6
I'm trying to reload the WMTS layer after changing some tiles on the remote WMTS server.
The problem is that I am not able to reload tiles in the current viewport (or in the current zoom level). Other ...
0
votes
0
answers
38
views
How to show .tiff file on openlayer map on specific coordinates in angular or js?
I have a tiff file and I want to show that tiff file on the Openlayer map on its respective coordinates. I tried many ways on youtube but could not find a proper way to show the tiff file on ...
-2
votes
0
answers
37
views
XYZ tile envelope units
The data to create the geospatial raster tiles is in meters. it is stored as cartesian rasters in postgis database. When an XYZ request is submitted to the database, a tile BBox envelope is generated ...
0
votes
1
answer
31
views
Openlayers imagelayer and imagestatic with custom imageloadfunction not loading if zoomed in?
My problem:
In my react app, I have some functionality that allows for getting an image from an API. If the image is added while the user is above a certain zoomlevel (differs depending on area, ~7.4 ...
-1
votes
0
answers
39
views
adding JSTS-Buffer to OpenLayers map is not viewing in particular map?
I have tried to create a buffer on an OpenLayers map. but the buffer is not displayed on the map.
Using Jsts-buffer example code
Give the geojson files Urls to connect dropdown values
but only map ...
1
vote
0
answers
35
views
Openlayer interaction: callbacks not getting fired
I'm trying to listen for PinchZoom interaction but I'm getting nothing in the callback.
Creating the map
this.map = new Map({
target: 'map',
layers: [
new TileLayer({
...
0
votes
0
answers
33
views
Unable to add event listener for MouseWheelZoom event in Openlayer map
I am trying to implement a functionality using openlayers with Angular in which I have to add one interaction using MouseWheelZoom.
Interaction gets added but control does not come inside the event ...
0
votes
0
answers
23
views
How to find exact location [user's possion not server possion] using javascript
I'm building a website and I have a button when I click on it, it shows me the internet server location instead of mine.
Does someone have a way of finding the exact user location?
0
votes
2
answers
57
views
OpenLayers6 and React
I am trying to implement OpenLayers6 ("ol": "^6.14.1") into a ReactJS project, but all the documentation is created in normal JS files and I can't find any good examples or ...
0
votes
0
answers
25
views
Want to completely remove old WMS tiles from Openlayers before new ones are drawn
This function draws the WMS tiles. However, when a new time is chosen some new tiles get drawn before all the old ones are removed so any attempt at animation is ugly. And also, you can't really tell ...
2
votes
0
answers
29
views
Layer loaded from GeoJSON is the wrong size in Openlayers
I am trying to use OpenLayers to show some road features that I drew on a non geographical image in qgis. The output geojson I am using looks as follows (only one feature shown for demonstration).
{&...
0
votes
1
answer
30
views
OpenLayers remove current marker before adding new
I'm trying to develop a web application with a tag location feature using openlayers. I want to add a maximum of one marker to the map when it is clicked. When the user clicked on the map for the ...
-1
votes
1
answer
25
views
How to write custom coordinateFormat of ControlMousePosition in Openlayers 6?
I use Openlayers 6 in project of Angular 14.
I don't know how write to coordinateFormat.
The following code does not work properly
import { createStringXY, format } from 'ol/coordinate';
import {
...
0
votes
0
answers
52
views
OpenLayers does not request tiles at low zoom level after updating the view with a new projection
At zoom level close to 0, if I update the view with a new projection, OpenLayers doesn't request all the tiles, only some of them. I have to pan or zoom in and out to make it request all the tiles.
I ...
-2
votes
1
answer
26
views
Want to change marker present in example given below, having problems with figuring out calculations
https://openlayers.org/en/latest/examples/modify-icon.html
If you refer to the above example, you will get to know that the default marker is changed with the new image, for which following fields are ...
-1
votes
1
answer
26
views
How to get default view for openstreet map based on markers?
If all the markers for particular users are all in the USA, then when users opens map, by default map should focus on the USA where all markers are visible, similarly If all marker positions are ...
0
votes
1
answer
31
views
How to style vertexes in OpenLayers?
I use this code to draw polygons. How to set style for all vertexes including cutouts?
This is my attempt to style the vertex points:
function getStyleFunction() {
const white = [255, 255, 255, ...
0
votes
1
answer
24
views
How to apply styles for polygon vertexes OpenLayers?
I have tried this code:
this.vector = new VectorLayer({
source: this.source,
zIndex: 400,
style: new Style({
fill: new Fill({
color: "rgba(255, 255, 255, 0.6)",
}),
...
-1
votes
0
answers
29
views
In Openlayer, how can I retrieve GeoJSON attributes in a specific radius?
I uploaded some GeoJSON files to the Openlayer map for my project. When I click on the map or any feature of the layer, if my desired layer is available within a 5-10km radius then how can I get its ...
-1
votes
1
answer
44
views
Open Layers GeoTIFF
Hi can somebody explain how to work with ol.GeoTIFF layer? I tried this tutorial https://openlayers.org/workshop/en/cog/true-color.html
OL version : 6.14.1
I tried to load the layer like this:
const ...
1
vote
1
answer
20
views
Using OpenLayers Map as an Angular service
I want to know if I you're aware of a way to use a service in Angular to create an OpenLayers map and pass that service to other components and update the map based on the interactions on those ...
-1
votes
0
answers
22
views
Openlayers merge gpx and geolocation dont work
I'm new to javascript, and I'm trying openlayers.
I would like to merge GPX data https://openlayers.org/en/latest/examples/gpx.html and geolocation-orientation https://openlayers.org/en/latest/...
0
votes
0
answers
20
views
Text annotations with openlayers
I am looking for some way to add text annotations on a map using OpenLayers with angular. I need to style the text as well. Not sure if there's a straight forward way of doing this. If there are any ...
-1
votes
1
answer
46
views
How to close Polygon during drawing OpenLayers?
I use Draw obejct to draw default polygon. It gives the following result:
polygon drawing OpenLayers
As you can see, the polygon is not closed. How to close it during drawing like it works after ...
0
votes
0
answers
20
views
How to change style of pointer after click selection OpenLayers?
I have two types of layers. After click over any it changes a style selection using new Select():
public makeFeaturesSelectable(): void {
function selectFeatureStyle(feature) {
const ...
-1
votes
1
answer
64
views
openlayers, drawing clouds, polygon with customized stroke
I am working with openlayers 6 and I need to draw clouds on the maps a polygon with half circles stroke or a linestring, it doesn't matter the type as long as I can modify it ( adding and removing ...
0
votes
0
answers
22
views
How to activate a map layer in indoorequal
I'm using indoorequal with openlayers.
I'm trying to load additional structures into a map from a local file, similar to the demo available at https://indoorequal.org/remote.html .
Scenario
In ...
-1
votes
1
answer
37
views
How to draw icon with image or text in center?
I have tried to draw icon in OpenLayers:
style: (feature: FeatureLike) => {
return new Style({
image: new Icon({
color: "red",
...
0
votes
0
answers
31
views
Show multiple layers with only one trigger in Openlayers
I am creating an Overlayers project with a lateral menu that allows me to turn on / off layers using a checkbox.
On the body of the HTML file I use the class= "visible0,1,2,3" to be a ...
0
votes
0
answers
54
views
Openlayers Overlay autopan doesn't work when map width is not 100% [duplicate]
Openlayers version: v6.
Overlay autopan is not able to move the map to display the entire pop-up window when the map container width is not 100% to the viewport(click at the right end of the map).
In ...
-2
votes
1
answer
64
views
How to draw the multyline in OpenLayers?
I have learned a Draw object in Openlayers.
I try to draw the dotted line when user moves the mouse. When user clicks the last and prev lines should be replaced on straight line.
How does it work, ...
0
votes
1
answer
42
views
Openlayer - filter layer from another layer using "in-like" clause
I have two Layer :
POLYGON
-Feature Id:1 Territory: A
-Feature Id:2 Territory: B
POINT
-Feature Id:1 Color:blue Territory: A
-Feature Id:2 Color:orange Territory: A,B
When hovering a point the ...
0
votes
0
answers
26
views
Why openlayers WKT reader returns Feature<Geometry> and WKB reader returns FeatureLike
Ok so I am trying to transition from WKT to WKB being stored in the database. First step was to rewrite OL's reader from WKT to WKB.
What I noticed however is that WKB returns FeatureLike instead of ...
0
votes
0
answers
43
views
Cursor pointer in OpenLayers on hover
Using the latest version of OpenLayers with React. Trying to change the cursor to pointer in the following way:
function mapOnMove(evt) {
if (evt.dragging) return;
const pixel = map....
0
votes
0
answers
23
views
I have this error when i create a new map and the distribution folder create automatically this files
Uncaught Error: Cannot find module '9'
at newRequire (harta.js:32:19)
at localRequire (harta.js:47:14)
at require.211._css_loader (harta.js:73:25)
at newRequire (harta.js:41:24)
at localRequire (harta....