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
0answers
26 views

Orient OpenLayers 6 labels along longest side of a polygon

I'm using OpenLayers with the EPSG 3857 Coordinate System and I want my polygon labels to be orientated along the longest side of the polygon. The labels in OpenLayers are aligned horizontally by ...
1
vote
0answers
18 views

Read the attributes of a WMS layer by clicking on the map

I'm trying to display a popup (containing the attribute data) by clicking on an entity in my layer with the WMSGetFeatureInfo control from OpenLayers. It's turning but without displaying the popup ...
0
votes
0answers
26 views

OpenLayers 6.x: Incorrect Static Image Location On Map — React NextJS

So I have been searching across the interwebs to find an answer to my problem that was answered a decade ago for a much older version of OpenLayers. I am trying to overlay a NWS Radar mosaic on top of ...
0
votes
0answers
21 views

Display attributes information of a layer in a popup (OpenLayers) [closed]

Je suis entrain de crée un site web , je travaille avec geoserver, openlayers 2-13-1 , geoext2-1-0 , j'arrive pas à afficher la carte et la couche des provinces d'une ville . J'ai besoin d'afficher ...
0
votes
0answers
15 views

How to prevent ol.interaction.Modify module's function?

If I use ol.interaction.Modify module with the latest OpenLayers 6, I can easily implement modify function of LineString. But even if the feature of other layers (like marker, etc.) is in front of ...
0
votes
0answers
23 views

GeoServer not recognizing the native SRS (UNKNOWN) while publishing a layer with custom SRS which I have already added on epsg.properties

I am having problem with the Native SRS for a custom projection which i have added in epsg.properties in a geoserver. These are the specific issues: When I try to publish a new layer with custom srs, ...
1
vote
0answers
18 views

Determine if a polygon feature is within a projection range in Openlayer 4

This question comes following a previous one that I posted yesterday (link). I have to show on a World Ocean Base map (projected as EPSG:3857) a number of areas. These are contained in a series of ...
0
votes
0answers
29 views

Map generation using MapProxy & Openlayer

I am new to openlayer 5 & mapproxy & I am trying to generate map using MapProxy 1.12 & openlayers5. I am using ubuntu 16.04 & have created virtual environment as in this document https:...
1
vote
2answers
43 views

Convert EPSG:4326 to EPSG:3857 in OpenLayers and React [closed]

Is there a way to convert coordinates from EPSG:4326 to EPSG:3857 in OpenLayers. Or does any one have a method that does this in Javascript?
1
vote
2answers
57 views

Filtering vector tile layer in OpenLayers map? [closed]

I have GeoDjango application for the visualization of household data with around 10k features. So I have used the vector tile for the visualization of these data. Now I faced the problem with the ...
2
votes
1answer
30 views

Applying JSON style from URL to Vector in OpenLayers

Can the style be a URL in OpenLayers? var layer_offline = new ol.layer.VectorTile({ declutter: true, source: new ol.source.VectorTile({ format: new ol.format.MVT(), url: 'http://...
1
vote
1answer
31 views

How to show single GeoJSON file features when changing projection with OpenLayers 4

On my map I load several GeoJSON files containing various polygons (areas). Each layer corresponds to a single file. I also created variable that aggregate sources and layers to enable a search engine ...
0
votes
0answers
20 views

Why I can see my WMS layer but when I click on layer, OpenLayers WMSGetfeatureInfo is empty?

I added a layer to my map by WMS service, I can see my layer, but when I click on layer It seems it can't return layer attributes (info). This is my code (I did get help from OpenLayers examples): var ...
0
votes
0answers
26 views

Why I can't see my WMS layers in OpenLayers except I've been login to GeoServer with admin user in same browser?

When I refresh my map page and I want see my WMS layers I can't see my WMS layers expect when I'm login to my GeoServer in same browser! no with API, if I don't use crossOrgin in openlayers I'll get ...
1
vote
1answer
21 views

Getinfo only returns the first cover inserted

I'm using GetInfo to view the cover information and my problem using this command is: The information displayed is not from the cover seen on the map, but from the first cover inserted in the code. I ...
1
vote
1answer
24 views

GeoServer layer property inaccessible from OpenLayers

I have a PostGIS table linked to GeoServer and eventualy with OpenLayers in a web map app. Recently, I have created and populated a new column in the table (called atgid) but it seems that I am unable ...
2
votes
1answer
32 views

How to deal with overlapping polygons from GeoJSON in OpenLayers 4

I have a series of GeoJSON files (generated by QGIS) loaded on to a map in OpenLayers 4 as different layers. Each file contains multiple polygons. When mouse-clicking each polygon a pop-up window ...
1
vote
1answer
59 views

Filter geometry based on map extent using OpenLayers

I need to summarize an attribute of a geojson based on the map extent. I want to sum values for all features intersecting bbox. I think that I must use the Bbox filter but isn't clear for me how I can ...
0
votes
0answers
32 views

OpenLayers: given the same number of Features, is it better to have one big Layer or several small ones?

Given a certain amount of features that sometimes don't fit all together inside the current window, is it better to use one single/few big layer/s or it it better to split the features among more ...
1
vote
1answer
43 views

Get attribute from multiple WMS sources

I'm using GeoServer and I need to put the value of NDVI from four different wms into a chart. I'm using also OpenLayer for my map. map.on('singleclick', function(evt) { var viewResolution = view....
1
vote
0answers
21 views

How to synch Zoom control and MouseWheelZoom interaction in OpenLayers 6?

In OpenLayers v6.3.1 the map has a Zoom control and MouseWheelZoom is enabled. The map view has 10 resolutions. In OpenLayers v5 prior to v6 using either the Zoom control or the MouseWheelZoom ...
0
votes
0answers
23 views

How to remove features out of the extent?

I am using openlayers tile strategy and custom load function. this.source = new Vector({ format: new EsriJSON(), strategy: tile(createXYZ({tileSize: 512})), loader: (extent: any, resolution: any,...
1
vote
1answer
38 views

OpenLayers bbox strategy does not work when zoom in

I am using OpenLayers 6 vector source and bbox loading strategy. this.source = new VectorSource({ format: new EsriJSON(), strategy: bbox, loader: this.loader(layer) }); So, when I open tha app ...
1
vote
1answer
27 views

Retrying failed TileWMS tile load in OpenLayers

I have a map in OpenLayers with TileWMS source that's not very reliable. At almost every full page load there are a few tiles that fail to load with status 503 - Service Unavailable. When I try to ...
1
vote
4answers
68 views

How to display shapefiles on an OpenLayers web mapping application that are provided by users as an input without making any changes in the database

I have created a web mapping application using OpenLayers 3 which is displaying the data that is stored in a database. Now I want to display additional data that is going to be provided by the users ...
1
vote
1answer
44 views

OpenLayers drawing curves

I'm trying to draw a Bezier curve in OpenLayers (geometryFunction2) but there is something wrong with my approach I don't get. The first line seems fine but I can't place the next one. It work's fine ...
3
votes
2answers
40 views

Missing Styles when loading KML file into Openlayers created in Google Earth

I've been trying to display a KML file with Openlayers, which I created with Google Earth. It is a simple polygon with white outline and 50% alpha black filling. In Openlayers it displays as a white, ...
1
vote
1answer
19 views

Manage WFS service from GeoServer

I'm trying to have a zoom to extents of WFS layer. I'm using this code: var map = new ol.Map({ controls: ol.control.defaults().extend([ new ol.control.FullScreen({className: 'ol-full-screen', ...
0
votes
0answers
26 views

Is it possible to change my Vector Strategy? Open Layers

I added a layer previously on my code, thats it's source scope. const vectorSource = new ol.source.Vector({ format: new ol.format.GeoJSON(), strategy: ol.loadingstrategy.bbox, loader: ()=&...
0
votes
0answers
27 views

WFS features and vector layer

I try do load WFS layer to my openlayers application according to this tutorial enter link description here Features from WFS layer are displaying on the map, but i discover that they are not belong ...
1
vote
1answer
32 views

Satellite image in OpenLayers

I would like to know if there is a satellite map for OpenLayers. I made the following code: new ol.layer.Tile({ // A layer must have a title to appear in the layerswitcher title: 'Stamen', // ...
0
votes
0answers
39 views

OpenLayers Map Click Event not getting called in ReactJS

Problem: OpenLayers(v6.3) MAP is visible in REACTJS(16.13) but click event on MAP is not getting called. Purpose: I want to place a marker and handle its click event to show some POPUP with data. Code:...
0
votes
1answer
19 views

Serving Tiles of format {z}/{x}/{-y}.png in Openlayers version 6.3.1

I am facing a problem in serving the map tiles in Openlayers the format for the tiles is {z}/{x}/{-y}.png but when i try to add this url into the tile source it is giving me the following error ...
2
votes
1answer
37 views

Why PostGIS st_transform length is different?

I have two query select sum(st_length(shape)) from sde.ways; result is: 24268 And select sum(st_length(st_transform(shape, 3857))) from sde.ways; result is: 32047 Same Linestring geometries are ...
0
votes
1answer
36 views

How do you pull EPSG:4326 tiles from GeopackageJS using OpenLayers 6?

I'm trying to leverage GeopackageJS for use in a mapping application using OpenLayers 6, but the documentation seems to be really iffy-- the link to the API documentation actually 404s and the ...
0
votes
0answers
40 views

Display Features based on Zoom Level using OpenLayers

I want to display roads(linestring) on the map using OpenLayers.currently, I manage to assign styling based on road type but when I run the server I can see all the data displayed. I want to change ...
0
votes
1answer
24 views

Openlayers: add padding to zoom in on a cluster

I need to add a padding to a zoom in on cluster function. I've used a part of this code to do this. var zoomCluster = function(pixel) { var feature = map.forEachFeatureAtPixel(pixel, function(...
0
votes
0answers
47 views

How can I detect overlapping geometries in OpenLayers 6.3.1

I'm using OL 6.3.1 and have a need to detect when the geometries of polygons overlap or intersect. Specifically I am trying to do something like this when a user draws a polygon: self.olMap....
2
votes
1answer
50 views

GeoServer CQL Filter doesnt work with Unicode

I'm using CQL filter to extract certain data from my GeoServer layer. var source = new ol.source.Vector({ loader: function (extent, resolution, projection) { var url = "http://...
0
votes
2answers
61 views

Get attribute table from WMS GeoServer in OpenLayers

I have WMS so I can easily display it in the map, but I want to get the attribute table of the layer from WMS. All solutions I found are about getFeatureInfo which is giving properties when clicking ...
1
vote
1answer
49 views

Preventing scaling during raster rendering in MapServer

I have encoded some metrics in a 4-band geotiff that will be served by MapServer (v7.4), and I want to "decode" them client-side for display using raster operations in OpenLayers (v6.1). (...
0
votes
0answers
36 views

Getting vertices of geometry that type is not known?

I am using a WFS service that serves Polygon and Multipolygon geometries. But I do not know ehich ones. So I am converting the wfs response to feature. this.http.get(url, { responseType: "text&...
0
votes
0answers
31 views

Vector tile selection layer (canvas) drawn outside the map div. Bug?

I loaded a PBF vector tile layers into my map, and when I select a feature, OpenLayers 6.3.1 creates the selected layer canvas outside the map. Is it a general problem, or just mine? I don't attach ...
0
votes
1answer
25 views

OpenLayers 5 multiple markers all end up at last position

I have a LineString in OL5 and I want to iterate over each segment and display a label at the segment end. I have this mostly working, but all the Overlay labels magically end up at the last position ...
0
votes
1answer
32 views

Popup filling with AJAX?

Is there a solution to fill a popup with content getting from a AJAX call, without JQuery in OpenLayers 5? The content is in *.txt files, or I can handle it to send the content as a JSON or HTML via ...
0
votes
1answer
96 views

Publishing web map on website using PostGIS, GeoServer and OpenLayers

I have been trying to create a web map using PostgreSQL/PostGIS - GeoServer - OpenLayers. However, the resulting map is on my localhost and the data published in GeoServer can be accessed solely ...
1
vote
1answer
78 views

Import ol-ext to a React - Open Layers 6 project

I'm trying to set up a React project where I want to use some of the tools provided by the ol-ext. I looked around and found some Codesandbox projects from the creator of the library but I was unable ...
1
vote
1answer
32 views

OpenLayers Style Text incorrectly aligned and moving on map resize

I have an OpenLayers map which I want to display SVG markers on with some text. I have got it to display the marker and it looks fine but when the map is resized the alignment of the text moves by a ...
2
votes
0answers
80 views

North polar projection OpenLayers + GeoServer

I'm trying to visualize some geometries in OpenLayers using a north polar projection. The data comes from the GeoServer and I have defined my projection in 949918=PROJCS["...
1
vote
0answers
29 views

OpenLayers 3+: Start/end icons

How to create markers/icons at the startpoint and endpoint automatically in OL/JS? I'm doing this right now - I know startpoint and endpoint from PHP analysis: var startpoint = new ol.Feature({ ...

1
2 3 4 5
58