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

How to Update Control When Layers are Changed

I have a control that allows the user to switch between satellite/street tiles. I want the text to update to show the next tile text when appropriate. Currently I am using the Control.render hook but ...
1
vote
2answers
45 views

Openlayers shows and paints polygons in the wrong place on the map

In the following code I call a geoserver service. Initialize map var map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ source: new ol.source....
1
vote
0answers
37 views

Adding border style to country which has geometry type polygon? [closed]

I have a drop down list and when I select a country name and the map goes to this country, I want to add a specific border style to this country (polygon geometry).
-1
votes
0answers
33 views

Using cluster in OpenLayers [closed]

I am using OpenLayer 3 ol version 6 library. Several layers are drawn: Map, vehicle movement. stopping points through which the vehicle passed. When I zoom out, the names of some localities ...
1
vote
1answer
56 views

Zoom level issue with openlayers 5 and custom tile generation using gdal2tiles

Now i have changed my code but the output is still not what is expected, because the resolution provided is of 0 - 8 zoom but my minZoom starts from 12 itself, will i get my tiles rendered ?? how ...
1
vote
1answer
21 views

Error: getGeometry is not a function

I have a GeoJSON file, I can select one of its objects and convert it to a feature object, I need to zoom to this polygon on the map so here is my code: part of JSON object that I convert: { "type":...
1
vote
1answer
43 views

How remove geometry vertexes on hover OpenLayers 3+

I am using modify interaction and would like to be able to delete vertexes by either clicking delete + mouse on the vertex or delete + hover vertex. delete + mouse works, delete + hover does not as ...
2
votes
0answers
39 views

Set HTML ID or class for an icon in OpenLayers [closed]

I wanted to know if there is any way to set an HTML ID for an icon in OpenLayers. For example, If I set an icon with HTML ID "icon1", I want to be able to access it using document.getElementById("...
1
vote
1answer
87 views

Smooth line animation on map

I tried to produce a smooth line animation with below code. How can I do this? I used OpenLayers with Angular. It works as a drawing line but I want more smooth movement something like this (http://...
1
vote
0answers
30 views

Predict the movement of an object on the map considering geodetic calculations in OpenLayers 3?

I need to represent the movement of an object (which has its own speed) but considering the geodedic calculations. I'm working with EPSG:3857 projection. How can I do this?
1
vote
0answers
44 views

Drawing circle of specified radius in meters using OpenLayers 3

I need to present a mask where the user put the radius (in meters) to draw a circle. How can I do this? Do I have to do geodesic calculations to get a circle that follows the projection of the map (...
0
votes
0answers
38 views

Dwithin not working on EPSG:4326

I have a layer in GeoServer called "pois". The layer is in EPSG:4326. Also, I have another layer but it is in: EPSG:31256 The problem that I'm having is that I'm trying to reach an all points around ...
3
votes
0answers
33 views

Canvas element with 'width: 0' in OpenLayers 6 instance on Vue.js

I am using Vue components to generate multiple instances of OpenLayers in the same parent component. Ultimately I am attempting to export an image of each instance of OpenLayers using the html-to-...
1
vote
1answer
21 views

How to build XYZ layer source for custom scales?

I have tile images in scales: 4, 6, 8, 12, 14 (in subdirectories). In smaller scale tiles are in higher zoom (in 14 scale zoom is minimal, in 4 scale zoom is maximal). I have prameters as below for ...
2
votes
0answers
33 views

Tiles map server - How to provide the same tiles on lower zoom?

I have my own map server defined like below. This is one layer, but have 4 layers for other zooms. Unfortunately for zoom lower then 8 I don't have tile images. Is possible to make zoom out lower than ...
0
votes
0answers
19 views

WMTS service is returning incomplete results

Observation: In GWC Demos page reached through the GeoServer admin UI, I am attempting to view a layer group. Some requests are working: https://serverUrl:8443/geoserver/gwc/service/wmts?layer=...
2
votes
0answers
49 views

OpenLayer's graticule doesn't properly work

I am making a map of Krasnoyarskiy krai subject of Russia. I have defined a custom projection that should be used for this area using proj4 string. I need to show lat/long grid only for this territory....
1
vote
0answers
39 views

Show overlay on top when zoom out in OpenLayers 4.6.5?

I have a tile layer, three vector layers. The tile layer has lots of overlays in it. I want to put vector layers on top when zooming out the map using OpenLayers 4.6.5. I tried to apply setLayerIndex ...
3
votes
1answer
38 views

OpenLayers Circle Style Update During zoom

I am using a stylefunction to dynamically draw an 'image' based on the feature geometry. The style function is dependent on the resolution (zoom level) so that the drawn items are a certain consistent ...
2
votes
0answers
35 views

Get Feature id in OpenLayers from GeoServer/PostGIS

With OpenLayers, I'm creating layers like ol.layer.VectorTile var projection_epsg_name = 'EPSG:900913'; var geoserverLayerName = 'teste:map_shape2'; const tileLoadURL= 'http://127.0.0.1:8081/...
1
vote
1answer
46 views

OpenLayers tiles size vs screen size

I'm using OpenLayers v6.1.1 and I would like to ask you to confirm that my understanding is correct. Take a look at below image: Am I right that there might be a situation that if I would take all ...
1
vote
1answer
23 views

How to dynamically rotate image in custom style in OpenLayers

I'm trying to make a custom Style in OpenLayers that replaces a path (Coordinate list) with an image at the end of the path pointing in the direction for the path (like the head of a snake). I am ...
1
vote
2answers
29 views

OpenLayers data format [closed]

I am just running an application using OpenLayers. All data is transfered from my database in GEOJSON format. My current task is to review the implementation of the data format. Important ...
2
votes
1answer
31 views

Getting tile URL in OpenLayers

I'm using Openlayers v6.1.1 and I'm trying to get URLs of all tiles in the current map extent. I was trying to do it in the following way: var tileUrlFunction = tileSource.getTileUrlFunction(), ...
2
votes
1answer
24 views

OpenLayers: Overlay doesn't work

I'm following an OpenLayers tutorial and in my current lesson we wanted to add an overlay to the webmap and when I click on the map it gives me the coordinates of that map. However, for me it doesn't ...
0
votes
0answers
45 views

Get projection or calculate latitude and longitude from a central point [duplicate]

I have a central point (with longitude) and I measure a radius (30º) degrees, I have a distance of 200 KM. Problem: know with precision what is the latitude and longitude of the point that is 200 km ...
1
vote
0answers
21 views

OpenLayers.Format.WMTSCapabilities vs ol.source.WMTS

Struggling with getting a WMTS layer working using OL2. I have it working with OL3 but unfortunately I'm working with legacy code and it needs to work on OL2. Using OL3 (working) var xml = '...'; //...
2
votes
1answer
12 views

Can't get the coordinates from OpenLayers polygon drawing

I'm building an app using Ionic 4 included OpenLayers. After drawing the polygon, I can see the coordinates on the console.log but I don't have a solution to get these coordinates. Here is what I ...
1
vote
0answers
28 views

Use a WFS-T layer in d3.js without adding a background map?

I am currently working on a d3.js project and would like to include a WFS-T layer to my SVG map to display and update location data stored in a PostGIS database. I know that I need to transform my ...
1
vote
0answers
62 views

WMS layer is displayed with ruined geometry in OpenLayers [duplicate]

I want to display a shapefile in OpenLayers using MapServer 7.6. It is shown properly in the browser using the mapfile's link. But when I try to display it in OpenLayers, the geometry is completely ...
1
vote
1answer
57 views

Draw a line of desired length and bearing in OpenLayers? [duplicate]

How can I create a straight line when I know the coordinates of the first point, and I know the distance and angle to the end point but I don't know the coordinates of the end point? Example: ...
1
vote
0answers
29 views

Managing images on OpenLayers

I am working on a web application with OpenLayers 6 currently, and it is my first foray into OpenLayers. I have managed to get the application to allow drawing and retrieval of images based on those ...
1
vote
0answers
40 views

OpenLayers GeoServer update an array of features using WFS-T

I am trying to update features using WFS-T update. I am sending the request from my website (OpenLayers) by passing an array of features. However, I have noticed that the attributes and geometry of ...
0
votes
1answer
38 views

Querying Esri WMS based on Polygon [closed]

I have an Esri WMS server serving raster data. I can query this using OpenLayers TileWMS, all appears beautifully on my basemap. I need to be able to query the WMS based on a polygon and display my ...
1
vote
0answers
25 views

How to change OpenLayers Map styles with bright.json

I got problem with using Bright.json I caant load that styles to map. So far I got let vLayer = new ol.layer.Vector({ source: new ol.source.Vector({ url: "/www/bright.json", ...
1
vote
1answer
26 views

Add WMS to OpenLayers after click

I have a working WMS service under http://localhost:8080/geoserver/nis/wms?service=WMS&version=1.1.0&request=GetMap&layers=nis%3Atest Also I have a Node JS application with OpenLayers. In ...
3
votes
1answer
101 views

Add a border and change border color of a marker in OpenLayers

I want to add a border color to the icons in OpenLayers. I also, want to be able to change the color of this border depending on the attribute of the marker. Is there any easy way to do this? The code ...
0
votes
1answer
15 views

Bootstrap 4 popover is not fixed on the map

I am using bootstrap 4 to show some popovers on the points of the map, but they are not fixed, when you scroll the map the popover changes position. In bootstrap 3 it works fine though. I don't ...
0
votes
0answers
41 views

Html2canvas cannot render map in OpenLayers 3

I'm using OL3 and the last version of Html2Canvas (1.0.0-rc.5). When I try to make a PNG screenshot of the div that embed the map it seems that the map itself is blank. Also the feature, that are ...
2
votes
1answer
53 views

Turf.js buffer distance not accurate

I'm facing a strange behavior using buffers in Turf.js. When trying to do a 50m buffer around a point, the result is actually closer to 35m. On the screenshot below, the smaller circle is a turf....
0
votes
1answer
34 views

OpenLayers vectorssource update feature

I am using the following code to plot weather readings on a map. It works but there is a very noticeable and annoying blink each time new readings are plotted. function draw_map(current_obs) { ...
0
votes
0answers
10 views

CORB block my layers from GeoServer [duplicate]

I'm trying to use a layer from GeoServer but Chrome is sending me message : Cross-Origin Read Blocking (CORB) blocked cross-origin response URL with MIME type text/xml. See URL for more details. ...
0
votes
0answers
29 views

Remove multiple features from the vector by category

vectorSource.clear() will remove all features. I want to remove specific features by category: I am adding the features on the vector. Data comes from json response. data.forEach(device => { ...
0
votes
0answers
19 views

How to display points from Geoserver WFS on OpenLayers map [duplicate]

I'm try to display my points set from Geoserver in Openlayers map. I want to use WFS service, but at the moment I see one point, additionally in wrong place! I want to display all at EPSG 4326. I ...
0
votes
1answer
50 views

OpenLayers tutorial: map doesn't show up

I'm following an OpenLayers tutorial and already there is something wrong after trying to represent a simple map. I will show you the code I copied from the tutorial and when opening my HTML file ...
1
vote
0answers
25 views

How to add text to LineString in OpenLayers?

We use OpenLayers 4.6.5. The code looks as following: const line = new Feature({ geometry: new LineString(points) }) line.setStyle( new Style({ fill: new Fill({ color: 'black' }), stroke:...
0
votes
1answer
52 views

OpenLayers template

I am currently doing a research for how to build a web map viewer. I decided to go with OpenLayers. I am now looking for templates as I do not think it is necessary to build from scratch. I found this ...
0
votes
0answers
44 views

OpenLayers 4: Load baselayer outside projection extent

I have a map that uses EPSG:3912. Then I have base layer from CartoDB. When I zoom out I see: My question is, if it's possible to have CartoDB layer loaded outside map extent (so that it fills white ...
0
votes
1answer
58 views

OpenLayers 5 forEachFeatureIntersectingExtent Method Not Correctly Selecting Features in Circle or Polygon?

Using OpenLayers 5.3.3 Draw a circle Get the extent of the circle in the drawend event: const extent = event.feature.getGeometry().getExtent(); The try to determine the features in the extent using ...
2
votes
1answer
38 views

Split linestring by selecting two points in OpenLayers?

I have a project where people can drag and drop a gpx file. This results in a multilinestring. People should be able to take a piece of their route and submit that. I was thinking of letting the user ...

1 2 3 4 5 54