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

Find index of Linestring element at feature, when hovering - openlayers/GeoJson

I have a Geo-JSON Linestring, this is drawn by 800 elements in OpenLayers 4.6.5. I'am trying to use the map.forEachFeatureAtPixel, and print a pop-up when hovering for individual elements on the ...
1
vote
1answer
192 views

OpenLayers Load KML Layer in the background

I would like to show a polygon in OpenLayers. The polygon was defined in 3 KML files with difference level of detail, ie: Low Resolution KML (with 100 points) Medium Resolution KML (with 1000 points) ...
1
vote
0answers
56 views

How to disable imageSmoothingEnabled for geoImageLayer?

Considering the code below (which uses openlayers and Viglino's ol-ext), how do I disable imageSmoothingEnabled for the geoImageLayer? I am trying to achieve the same thing as in this question, but ...
0
votes
1answer
103 views

Layer won't show on OL map

I am new to OL and I'm trying what I thought was a pretty simple thing. I would like to see a second layer that shows lat/lon points. Is the code below the correct way to achieve it, or am I missing ...
-3
votes
2answers
140 views

Running OpenLayers from localhost? [closed]

How to run OpenLayers using localhost? I already installed Apache Tomcat and GeoServer war. In what folder should I place all the OpenLayers file?
0
votes
0answers
36 views

Adding feature to highlight layer forces redraw of original layer

I have two VectorLayers setup, one for my actual features and another one for highlights (I'm rendering ~10000 features so I have a separate layer for highlight as recommended by ahocevar). However, ...
0
votes
0answers
45 views

I can not Add GML Layer in OpenLayers 4

I use openlayers 4 and gml layer is file type, but when i add gml layer to map using ol4, i have a ploblem. Gml is polygon but it appear as some point in map. Can not anybody help me? Below is my ...
1
vote
1answer
86 views

Open Layers 5 - Dynamically toggle zoom buttons [closed]

I would like to disable the zoom in button if a user tries to zoom in past a certain level. I would like to disable the zoom out button if a user tries to zoom out past a certain level. I see that ...
1
vote
1answer
49 views

How to fix layer styling in OpenLayers 5?

I'm trying to draw a new layer every time user clicks on the map. My styling function can be seen below; function CatchmentLayerStyleFunction(feature) { var colors = ['rgba(255,0,0,0.5)', 'rgba(...
0
votes
1answer
72 views

How do I add a georeferenced JPEG with a JGW Worldfile to OpenLayers v5.3.0?

I have a JPEG file with an associated .JGW worldfile containing the following data: 0.0144218 0 0 -0.0144218 -65758.8265181 -130841.5565499 My Jpeg is 21177*14242 pixels resolution. I'm currently ...
1
vote
1answer
143 views

CORS issue loading an external local GeoJSON into OpenLlayers 5

I have a local folder on my network with my HTML file and two subfolders, one with the downloaded folder from OpenLayers (renamed ol) and the other with my GeoJSON file (data). When I try to load the ...
0
votes
0answers
54 views

WFS Transaction Post Method 403 OpenLayers 3 + GeoServer

I am having difficulty understanding the topic when it comes to XML generated from GeoServer and how can we interact with it. I want to to implement WFS transaction service and updating my attributes ...
1
vote
2answers
253 views

How to pass tile size of to 512 using OpenLayer 3 and GeoServer 2.14

I am trying to change the default tile size of 256 to 512 using OpenLayers 3. Code is working fine for normal WMS request, but giving error (tiles not loading) for WMS-C request. My sample code is: ...
1
vote
0answers
30 views

Cycles in LineString in PostGIS table?

I have a LineString table in PostGIS, which represents wiring in streets. Where the geometry column represents the wiring lines; firstpoint is the first geometry point (cable segment); lastpoint the ...
1
vote
1answer
298 views

OpenLayers: How do I remove a layer based on a value?

In React, I'm using a pagination that returns a certain amount of results on each page. Using the address of these results, I convert them to longitude and latitude using a geo-coder package and set ...
1
vote
1answer
47 views

Publishing a big raster layer via GeoServer

I have a big raster layer (7GB) and I want to publish it so it can be accessible from my Geoportal using OpenLayers 4. I couldn't find a clear procedure to do that, I started by tiling the image but I ...
0
votes
1answer
325 views

How do I change the style of all markers in OpenLayers3?

This is probably a newbie question, but am at my wits end. I have a map that has several markers (see attached code). What I am trying to do is alter ALL the markers depending on a map event (e.g., ...
1
vote
1answer
117 views

Merge Advanced View Positioning and View Animation functions

I'm trying to merge two functions that are displayed as OL's samples, the Advanced View Positioning and the View Animation. I can successfully change the view with the animation method, but I can't ...
2
votes
1answer
119 views

In OpenLayers how can I enable users to cancel the completion of a polygon, and carry on drawing it?

I am using the OpenLayers v4.6.5 Draw interaction. drawInteraction = new ol.interaction.Draw({...}); map.addInteraction(drawInteraction); I want users to be able to add properties to the features ...
2
votes
1answer
165 views

Print XYZ Layer Using Geoserver, Mapfish, GeoExt

How can I get base layers added to an OpenLayers map using the OpenLayers.Layer.XYZ method to print in MapFish/GeoServer? The Geoserver/Mapfish print service is not printing any of my XYZ base layers ...
0
votes
0answers
36 views

Adding 3D GML file in OpenLayers

I have a GML file which has Z values associated. Is there a sample to show this GML file with 3D in OpenLayers?
1
vote
1answer
236 views

Detecting polygon self-intersection

Currently using OpenLayers to allow users to zoom/pan to an area and drop a modifiable 1x1KM Square Polygon. As this polygon is modifiable, for the purposes of validation I need to ensure the final "...
1
vote
1answer
47 views

OpenLayers freehanddraw forEachFeatureInExtent returns features not in shape

I am not a newbie. I am trying to get the features(icons) found inside a closed freehand line. The approach I am taking is to take the extent returned from the drawing and use it to get the features(...
0
votes
0answers
55 views

OpenLayers forEachLayerAtPixel and MapServer .MAP file COLOR

I'm trying to use map.forEachLayerAtPixel in OpenLayers to see what layers are clicked, but I have a layer in the background that is a grid served by Mapserver with a grid.map file that is just a ...
0
votes
1answer
172 views

getFeatureInfo in OpenLayers using text/javascript returns unselectable popup

I am trying to make a getFeatureInfo request (OL4) and display a popup with data, that come from a geoserver layer. Initially I did this: map.on('click', function (evt) { var ...
2
votes
1answer
128 views

Openlayers 5 scaleline has gives wrong results

I am using Openlayers 5 (modules from NPM) and I am having a problem with a scaleline in my map. // from https://epsg.io/2264.js proj4.defs('EPSG:2264', '+proj=lcc +lat_1=36.16666666666666 +lat_2=...
1
vote
1answer
351 views

Loading WFS GeoJSON from Geoserver in Openlayers

I am trying to load a WFS JSON layer into my web map. I am running the web page on a MAMP server. The layers are loaded from Geoserver and from a POSTGIS database. I have 2 WMS layers being loaded ...
0
votes
2answers
675 views

Get GeoJSON from a database by the AJAX method for OpenLayers

I have this code: if (ol.proj.proj4 && ol.proj.proj4.register) { ol.proj.proj4.register(proj4); } var features = new ol.format.GeoJSON().readFeatures( $.ajax({...
1
vote
1answer
381 views

How to get extent of Image layer in OpenLayers?

Considering the code below (which uses openlayers and Viglino's ol-ext), how do I get the extent of the geoimg? var map = new ol.Map({ target: 'map', view: new ol.View({ zoom: 18, center: ...
1
vote
1answer
65 views

How to display TileWMS layer 0-360 degrees

i receive from geoserver TileWMS layer that have extent from 0 to 360 degrees, and when i load this layer on map i can see only part of layer, becose my map have extent from -180 to 180 degrees. How i ...
2
votes
0answers
425 views

OpenLayers: change cursor upon hovering over feature

I want to change the mouse cursor to a pointer when the mouse is hovering over a feature. I currently have the following: this.map.on('pointermove', evt => { if (!evt.dragging) { this.map....
1
vote
2answers
240 views

GeoServer WMS layer won't load on OpenLayers 5

I was making some tests using Tiger products: I converted one .shp in a PostGIS database using shp2pgsql, then imported the db into GeoServer; the layer works fine with the preview provided by ...
0
votes
1answer
87 views

Is vector tile a feasible option for dynamic data?

I want to create an application using vector tile. I am using OpenLayers 5 and GeoServer 2.14 for this purpose. My data (stored in PostgreSQL+PostGIS) has around 2.5 lakhs geometry (road network) ...
0
votes
1answer
51 views

How to calculate the Longitude and Latitude of rotated polygons in Openlayers3?

We are using external Transform library with Openlayers for the polygon scale,Translate and rotate actions. After rotating the rectangle/square/polygon, when we scale it, the shape is getting ...
3
votes
2answers
148 views

Making WMS GetFeatureInfo request gives Invalidpoint response?

When I make a GetFeatureInfo request to a WMS service, I get an invalid point response. I wonder what is missing from my request. My Layer definition : var Parcels = new TileLayer({ name: '...
1
vote
1answer
79 views

In OpenLayers how do I prevent linestrings and polygons disappearing as I zoom out?

I can see how to do this using a feature style function with 2 styles (similar to the Custom Polygon Styles example). One would be the normal linestring/polygon one and used at high enough zooms. The ...
2
votes
2answers
1k views

Unexpected token Identifier error - Import OpenLayers

I'm trying to use some OpenLayers libraries in my code, and called him in JavaScript like this: import Map from 'ol/Map.js'; import Overlay from 'ol/Overlay.js'; import View from 'ol/View.js'; ...
1
vote
2answers
412 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
0answers
92 views

GeoServer WMS layers (with data) on same region of OpenLayers 3

There are 3 layers (image and tile) from GeoServer and sits on top of each other. Now I need to read data from these three different layers in UI (jsp). <%@ page language="java" contentType="text/...
0
votes
0answers
52 views

Can OpenLayers show map in projection other than wgs84 or UTM, for example Albers projection?

I've managed to show map in both utm or wgs84 in OpenLayers but Albers projection seems not possible as it does not have bound? Not sure about this, might be what I'm doing is wrong.
2
votes
1answer
154 views

OpenLayers: prevent map from resizing [closed]

We are using OpenLayers on mobile devices. When ever the keyboard is shown, OpenLayers resizes the map. This gives us performance issues when there are many features on that map. It takes a long time ...
1
vote
0answers
67 views

PerpendicularOffset is not working for vector tile

I want to create an application using vector tile. I am using openlayers v.5 and geoserver 2.14.1 for this purpose. In geoserver SLD i have added OGC filter which filters geometries on the basis of ...
2
votes
1answer
271 views

How to get bounding box of WMTS request

I want to create an application using vector tile. I am using openlayers v.5 and geoserver 2.14.1 for this purpose. I have already rendered vector tiles, but not able to get bounding box of the vector ...
1
vote
1answer
118 views

Select Features in qgis2web - openlayers

After using qgis2web to export a map, I am looking to modify the qgis2web.js file to have the possibility to select (highlight) features on click and keep them selected until I click somewhere else (...
2
votes
1answer
244 views

How to snap to a geojson-vt layer (Vector Tile Layer)?

I'm using geojson-vt to render a large geojson (originated from OSM) file. This file contains all road from a state (extracted with overpass-turbo way[highway="*"]). I'm buinding a domain-specific ...
1
vote
1answer
95 views

How to avoid empty popups when GetFeatureInfo request is empty

I set up a WMS with QGIS SERVER. I am querying it via a web app based on OpenLayers. Everytime I click on my map, I send a GetFeatureInfo to a specific layer passing the coordinates where I clicked, ...
1
vote
2answers
234 views

How to pass viewparams with vector tile request using open layers 5

I want to create an application using vector tile. I am using openlayers v.5 and geoserver 2.14.1 for this purpose. I have already rendered vector tiles, but not able to pass viewparam along with ...
2
votes
2answers
344 views

GeoJSON put in the OpenLayers maps

I am a beginner in OpenLayers. I would like a GeoJSON to be displayed on the map. Can you provide me with some example code to allow me to build this small project? The GeoJSON code is: {"type":"...
1
vote
2answers
137 views

Reloading OpenLayers 5 WMS automatically with new data

I am making a weather application. It is almost finished now, but I just have one problem left. I want a WMS-layer to automatically reload every few seconds. I thought I had the solution, but it seems ...
0
votes
0answers
30 views

How to handle Update error: Transaction does not have authorization for mytable3:mytable3.5?

I am building collaborative mapping app using openlayers 5.3.0, geoserver 2.14.0 and postgresql 10.4. I want the user to be able to update features using wfs-t but before updating, the user needs to ...