Questions tagged [openlayers]

Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later

737 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
51 views

OpenLayers 4 get style from GeoJSON not find

We created an API that returns a GeoJSON in accordance with this styling guide but then OpenLayers doesn't find the style key once I want to style each feature, here my code var appLayer = new ol....
1
vote
0answers
122 views

Draw and GeometryFunction (OL5 - Typescript)

I'm trying to update my OL3 code (javascript) in OL5 (typescript) and I don't know how to fix this "GeometryFunction". Do you know how to build the GeometryFunction object? var myDraw = new Draw({ ...
1
vote
0answers
28 views

Openlayers GeoJSON reprojection issue 4.3.3 vs 5.3.0

While switching from ol 4.3.3 to 5.3.0 I encountered a problem. The WMS layers work as I expected (display in the right location), geojson data don't. I read all the data from the same service in ...
1
vote
0answers
26 views

Changing features attributes in OpenLayers

I am using OpenLayers 5.3.3 and I want to change attributes of the specific feature in my map in OpenLayers. After changing the features I want to the changes to be updated in my map. this....
1
vote
0answers
27 views

WFS-T insertion problem OpenLayers3

I am trying to send my drawn features with WFS-t to DB. This particular layer has two columns in DB ogc_fid(which is autoincrementing primary key) and wkb_geometry (type geom, which is my geometry ...
1
vote
1answer
119 views

Marker shows as a dot instead of the icon image in openlayers

i am trying to add icons on my map using features but instead of showing the icosn i get a dot on the map in that position. let map = new Map({ target: "map", layers:[ new TileLayer({ source: OSM(), ...
1
vote
0answers
34 views

Line and point feature data is not returned by getGetFeatureInfoUrl method after some time

I have web based GIS application with multiple layers. Layers gets rendered as image from GeoServer. Now upon clicking anywhere on the map data of overlapping layers (including line and points) shows ...
1
vote
0answers
129 views

Show geospatial TIFF as base layer in OpenLayers using GeoServer

I am trying to show a GeoSpatial TIFF file as a base layer in OpenLayers, on which further layers can be imposed. Upon trying to add the TIFF file as GeoTIFF store GeoServer throws below error: ...
1
vote
1answer
142 views

SVG does not show up in OpenLayers

I tried adding an SVG as a layer on my map but it does not show up. //For registering EPSG: 2326 import * as proj4x from 'proj4'; var proj4 = (proj4x as any).default; import {register} from 'ol/...
1
vote
0answers
158 views

Applying style from QGIS to OpenLayers VectorLayer?

I have a vectorlayer exported from QGIS and added to an openlayers map. I now want to style this layer according to the style I use in QGIS. It consists of numerous line features and they should be ...
1
vote
0answers
63 views

OpenLayers OpenStreetMap OSM not rendered

I am trying to render a part of OpenStreetMap offline, previously loaded as map.osm (OSM XML). I'm starting a localhost and loading the xml from disk. I tried to use similar example (https://...
1
vote
0answers
183 views

Use svg file in openlayer to represent a layer

I want to use an SVG file as a source for one of the layers for my map in OpenLayers. The svg file is in a coordinate system such that it overlays my coordinate system of my map. I have tried the code ...
1
vote
0answers
44 views

Why TreeView Kendo is not executed properly?

I made a tree view kendo to enable the user to turn off or turn on the two layers "osmlayer" and "bing_road". but the treeview is just shown and does not work. first of all chrome debugger showed that ...
1
vote
0answers
218 views

Setting FontFamily in OpenLayers Text Label

Changing the font-Family of a style objects' text label does not have an impact - it always looks the same, no matter what font-family I set. Do I have to provide the respective fonts to openlayers ...
1
vote
0answers
70 views

How to display my XYZ Tiles at a certain extent

I am using OpenLayers to create a map. I am providing my own source using XYZ. I want to be able to display my tiles at a certain extent and not go out of this extent. How can i do this ? proj4.defs('...
1
vote
0answers
298 views

Extracting bounding box from the polygon geometry in OpenLayers

Suppose I have a geometry like below: POLYGON((8744004.877693035 1958621.044138512,8744013.76051175 1958620.4469742286,8744019.582863515 1958613.8781671105,8744018.98569923 1958611.3402189056,8744015....
1
vote
0answers
33 views

Add parsed GeoJSON points to OpenLayers and make them Clickable

I have points layer, displayed in OpenLayers map. I want to make them clickable, so when I click on every point I get the property I want (ex: coordinates). I'm newbie in OpenLayers and don't know ...
1
vote
0answers
60 views

Limit custom tiles to certain extent in OpenLayers

I want to fit my custom tiles at a certain region. For example let's say i have custom tiles for a certain country (example: USA) and I am using OSM or anything at all. How do i make sure that my ...
1
vote
0answers
279 views

Get Modified Feature from Modify Interaction

THIS QUESTION IS STILL OPEN AND OF INTEREST Openlayers: 4.6.5 I have a Modify Interaction and two active Select Interactions. The Modify Interaction is instantiated like this: var interaction = ...
1
vote
0answers
158 views

OpenLayers getText() from style function

I have a feature with a label set via feature.style.text. In my unit tests, I need to grab the value of the label. Normally I would use getStyle().getText().getText(). However, in the example below ...
1
vote
0answers
344 views

Not able to display KML file - OpenLayers

I tried to load my KML file from one of the OpenLayers examples import Map from 'ol/Map.js'; import View from 'ol/View.js'; import KML from 'ol/format/KML.js'; import {Tile as TileLayer, Vector as ...
1
vote
0answers
54 views

Transformation issue with SVG to GeoJSON conversion

I have a vector image in SVG format. (without georeferences) I am trying to display it using OpenLayers to display properties of different polygons in it. I tried converting it to GeoJSON but the ...
1
vote
0answers
144 views

Using olms to style self hosted mbtiles from openmaptiles not working

I've downloaded a OpenStreetMap vector tiles (.mbtiles) file from openmaptiles.com and successfully hosted them using node.js with the mbtiles and express node modules. I want to use a style gotten ...
1
vote
0answers
253 views

Show/Hide labels of Vector Tile layers on button click

I have displayed vector tiles layers with "application/vnd.mapbox-vector-tile" format in Open Layers 3.While creating vector tile I have applied only image style. I want to display labels for existing ...
1
vote
0answers
768 views

Getting distance between route and points around that route?

I have a route between 2 points by means of OSM routing service. I want to get the distance between route and points around. How can I achieve this? I created this route by the following example ...
1
vote
0answers
242 views

OpenLayers Icon with ngClick

I am working off the OpenLayers Icon Symbolizer example (https://openlayers.org/en/latest/examples/icon.html) to create an equivalent to a Google Maps marker new google.maps.Marker({...}) With ...
1
vote
0answers
172 views

Reusing style and setting feature text label in OpenLayers?

In OpenLayers 5 I have a vector layer which can display 16K features in certain portions of the map. Each feature has a text label that displays a unique name. If I create a new style for each ...
1
vote
0answers
38 views

Adding marker with specific functions on OpenLayers?

I am new with OpenLayers, my problem seemed easy, but I have troubles with that. I am trying to make some markers when the map loads up, I need 3 of them lets say and also I have some callback from ...
1
vote
0answers
419 views

Calculating pixels coordinates from lat/lon

I'm trying to develop a WPS that would print maps to images and PDFs. I don't want to use Mapfish because of its limitations, and because of some customization I need to add to the printed maps. My ...
1
vote
0answers
118 views

Very slow loading while fetching WMS layer as image/svg ol5

I want to fetch WMS layer as SVG image but it is loading very slow. How to resolve this issue? Here is my code var grid_10hact = new ol.layer.Image({ title: '10 Hactare Grid', source: new ol....
1
vote
1answer
290 views

Setting template or drawing layout to print map ol5

I have created a portal which export map and then print. I just wanted to add template or draw layout in canvas for that pdf as shown in the picture below. Here is my code: //print map var dims = { ...
1
vote
0answers
36 views

Organizing large numbers of vector layers with GeoServer

I have a large number (100,000+) of vehicle GPS paths in a PostGIS database. I need access to all of them on my web page, however, I don't usually need to view more than a handful on the map at any ...
1
vote
0answers
449 views

GeoServer returns 401 unauthorized when requesting data via openlayers

When using the line crossOrigin: 'anonymous',, it returns 401 unauthorized response. When commenting out that line it works, but I have to be log in to the GeoServer. Update: I have changed the ...
1
vote
0answers
146 views

Keep the popover in the same position when zooming in the map with Bootstrap 4 and OpenLayers 5

I tried the popover example from the OpenLayers web site: https://openlayers.org/en/latest/examples/overlay.html It works very well but when I change the version of Bootstrap to version 4 and jQuery ...
1
vote
0answers
104 views

Calling external plugins downloaded via Plugins through a separate out of QGIS Python Script

I was wondering if I could produce webpages daily by automatically creating a standalone python script, outside of QGIS. My webpage should ideally contain various layers and an interpolation on top ...
1
vote
0answers
373 views

Popup data does not change from one icon to another without closing the popup first

I am working on an application that will display markers on an OpenStreetMap. I can get the markers to display correctly on the map via my function, and I have assigned each marker details specific ...
1
vote
0answers
3k views

Increasing size/height of OpenLayers map/canvas?

I'm trying to let the Map/Canvas height of OpenLayers 100%, but I'm not able to do it. I've already tried putting in several places the "height: 100%;" and used the "map.updateSize()" function, but ...
1
vote
0answers
33 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
0answers
233 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) ...
1
vote
0answers
138 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 ...
1
vote
1answer
222 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 (...
1
vote
0answers
545 views

Print Openlayers WMS map with fixed scaling

I need to print a map with a fixed scale (1:500 and 1:1000) on A4. The online map is done with Openlayers, the print request is sent to QGIS Server using WMS getPrint function. I mange to get an ...
1
vote
0answers
71 views

Setup for several origins for a WMTS in OpenLayers

I´m trying to setup a map with a WMTS as a layer with help form this example: https://openlayers.org/en/latest/examples/wmts.html The layer works fine for the first three levels, but after the third, ...
1
vote
0answers
272 views

Selecting WMS layers from GeoServer in OpenLayers application?

I am making a weather application and I am almost there! I can show my GeoServer WMS-layers in my browser using OpenLayers 5. What I want to accomplish is that the user can switch between different ...
1
vote
0answers
233 views

Leaflet - two colors same path

Wanted to know if is there a way to get a single path (line) to have 2 colors? for example one next to each other I want to display 2 different paths (multi poly-lines) at same times, and each one ...
1
vote
0answers
420 views

OpenLayers. Slow map after render heatmap even when I clear the layer source

I'm working in a map with about 10 layers and it works fine, when I create a heatmap it becomes slower, that's something I was expecting, because the source has about 2000 points. When I want to make ...
1
vote
0answers
59 views

Openlayers 2: [In Touch] Pinch zoom action triggers click event at the end. How to prevent click on pinch zoom

Openlayers 2: [In Touch] Pinch zoom action triggers click event at the end. How to prevent click event registered on map getting triggered when pinch is done
1
vote
0answers
751 views

OpenLayers : how to dynamically change projection of a Tile Layer?

I've added a tile base map and and a couple of vector layers using OpenLayers. I'm implementing a change map projection functionality. For that, I need to change map projection and all added layers . ...
1
vote
0answers
190 views

Dynamic colouring of SVG-icons in OpenLayers 2

I've got an OpenLayers 2 map with a lot of point features that need to be represented using a number of different SVG-symbols. Unfortunately, the marker icons need to be displayed in different ...
1
vote
0answers
223 views

Openlayers: with a list of features, how can I organize them by distance from a coordinate

Let's say I'm using openlayers (5) and I have an array of features, they can all be from different layer sources, and I have a set of coordinates. What is the best way to sort that array so that the ...

1
3 4
5
6 7
15