Questions tagged [openlayers-5]

v5 specific questions on the OpenLayers mapping library

OpenLayers v5 is the latest release of the OpenLayers mapping library.

From https://openlayers.org/:

OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds. It is completely free, Open Source JavaScript, released under the 2-clause BSD License (also known as the FreeBSD).

v5 reworked the library as a set of ES Modules, and improved compatibility with mainstream module bundlers.

317 questions
-1
votes
2 answers

In Openlayers, how can I scale the stroke width of a MultiLineString based on the number of times the same coordinates are passed through?

My MultiLineString currently is styled like this: 'MultiLineString': new Style({ stroke: new Stroke({ color: 'green', width: 1 }) }), And the coordinates for my MultiLineString looks something like this: [ [[3, 8], [4, 10],…
rykener
  • 711
  • 1
  • 6
  • 16
-1
votes
3 answers

Openlayers dateline crossing linestring disappears

I am working on openlayers, there is an issue when I try to add a linestring on the map which crosses the dateline several times. To display the linestring across two worlds in the continuous segment I have added a function HandleDateline() which…
-1
votes
2 answers

Openlayers not able to add polygon feature on the map

I am trying to add a polygon on openlayers map, but it is not being rendered. I have tried transforming the points of polygon too but still no error in console and no output. Dont know what is being wrong practiced by me. Please point me in the…
capnam
  • 429
  • 9
  • 25
-1
votes
1 answer

Open Layers: How to display svg icon for a feature with certain offset from the center

I have to display multiple features on the map using OpenLayers. Each feature must be represented by 2 images (2 SVG icons). One of this icons must be anchored at the features coordinates but the second must be shifted with a fixed amount of pixels.…
Slawek
  • 1
-1
votes
1 answer

Add simple markers/points with OpenLayers

I've been searching for a day about how to place a list (array) of markers on an OSM/OpenLayers, but unfortunately, the official example wouldn't work for me. Can you please show me the best way to show the map and then add it an array of…
BlueskyFR
  • 135
  • 1
  • 3
  • 10
-1
votes
2 answers

How to download the OSM tiles for selected part of map

I want to download the map offline for a selected part of the map with single Zoom level with Openlayer OSM layer. I have got the four corner of map i.e display section of a map. But need to get the all tiles image or tiles between that four…
-1
votes
1 answer

Create great circle in openlayers 5

I need to create a circle with an X radius, in meters, accounting for the curvature of the Earth. Back in OpenLayers 2, we had destinationVincenty, which helped to calculate the destination from a point, taking into account the angle. However, this…
victor
  • 1,532
  • 1
  • 13
  • 32
-1
votes
1 answer

Geodestic measures in OL 5?

This example, url below, uses OL-3 with an option to do geodestic measures uses "var wgs84Sphere = new ol.Sphere(6378137);" http://www.rhone-mediterranee.eaufrance.fr/milieux-aquatiques/poissons/js/openlayers-v3.19.1/examples/measure.html How can I…
user1939338
  • 117
  • 9
-1
votes
1 answer

Openlayers 5 multi-color points

I have the code to display 7 points with blue color. Now I need to display 7 points in different colors (for example 2 points with red color, 2 points with green color and 3 points with blue color). And I need points clustering work for these points…
-1
votes
1 answer

OLv5 vector layer with dynamic source not rendering

I'm brand new to OL as of last week, so I apologize if I've missed something obvious. It's mostly cobbled together from examples, but I'm pretty sure I understand what's going on at this point. You can see my code in action here:…
fleur
  • 3
  • 3
-1
votes
1 answer

Check if coordinates are valid EPSG 3857 , using Openlayers 5

I am using openlayers 5 along with angular6. I have created a simple form that user can give a X and Y of EPSG3857 coordinates, submit and a point will be rendered there and the map will zoom there. I am using a vector layer for that. I want to…
slevin
  • 4,166
  • 20
  • 69
  • 129
-1
votes
1 answer

Interactive features in vector layers in openlayers 5

I am using openlayers 5.1.3 and I confused as to how to create the functionality of clicking on a feature of a vector layer, get exactly the one I clicked and then get its properties. I am following this example that is the only relevant I found. I…
slevin
  • 4,166
  • 20
  • 69
  • 129
-2
votes
1 answer

LineString to latitude/longitude pairs OpenLayers

How can I get a collection of latitude/longitude pairs for a given LineString which may be in raw or compressed format in OpenLayers 6? var draw; function addInteraction() { var value ='LineString'; if (value !== 'None') { draw = new Draw({ …
-2
votes
1 answer

GUIDE4YOU - how to add an ArcGIS REST Feature Service layer

I was wondering if Guide4You supports adding an ArcGIS REST Feature Service layer? For example the official Openlayers example: https://openlayers.org/en/latest/examples/vector-esri.html I hope someone can help me out! Kind regards, Sam
Sam
  • 23
  • 4
-2
votes
1 answer

Is there any chance to change drag map direction key(Alt+Shift+Drag) to Ctrl+Drag in openlayers 5(keybinding)

in my app am using angular 6 and openlayers V5. am very new for this openlayers i have done directions, am able to set view direction(input client's choice) i have changeling to drag on map directions using Ctrl+Drag instead of…
kks
  • 342
  • 5
  • 25
1 2 3
21
22