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
0
votes
1 answer

Get the actual width and height of a point feature in OpenLayers

I am trying to figure out a way to get actual width and height of point feature. I.e., the image + text and not just the latitude / longitude of the geometry. So far, I learnt that I could get coordinates by using the following…
Vishal
  • 816
  • 11
  • 19
0
votes
1 answer

How to style vertexes in OpenLayers?

I use this code to draw polygons. How to set style for all vertexes including cutouts? This is my attempt to style the vertex points: function getStyleFunction() { const white = [255, 255, 255, 1]; const blue = [0, 153, 255, 1]; …
Araviz
  • 97
  • 1
  • 6
0
votes
1 answer

OpenLayers Interaction is immediately removed after mouse click?

I have created a map according to OpenLayers 5.3. according the docs @ here https://openlayers.org/en/v5.3.0/examples/draw-features.html I draw a feature/interaction, however this 'point' is immediately removed after mouse click. you may view my…
MilAD86
  • 1
  • 1
0
votes
1 answer

Apply a Gradient to an Icon in Open Layers

On my project, I originally used CircleStyle to create points on a map and then used fill: new Fill({ with CanvasGradient to style the point with two colours. I now want to use a custom icon (for example 'icon.png') instead of just a coloured dot…
samsonM
  • 9
  • 2
0
votes
1 answer

how to show a pop-up/overlay window

i am trying to show an overlay containing the position of where the mouse is clicked. i referred to the example in openlayers official webpage here but when i run the code, the console.log message is displayed showing the coordinates of where the…
0
votes
1 answer

How to rotate static image in openlayers 6.x

I need to create and rotate a static image layer in openlayers 6. The creation of static image is working using url and imageExtent and i can see the image inside the map. new ImageLayer({ source: new Static({ url, …
karlos
  • 807
  • 1
  • 8
  • 38
0
votes
0 answers

How to draw axes (x axis and y axis) for static image (drawn using raster data and canvas) in openlayers?

How to draw x axis and y axis for the static image in open layers? Static image is formed using raster data and kept inside canvas and placed as a layer in Map component. X axis and y axis should zoom according to raster zoom.
0
votes
1 answer

【openlayer】add a feature to layer,but can not get the feature by click event,how to resolve the problem

Question openlayers version: 6.4.3 Add a feature which is created by a SVG string to map,then click the the feature on the map, but can not get the feature from the callback function. However, i make a feature with a nomarl image url, i can get the…
0
votes
1 answer

OpenLayers vector tiles selection not working properly

I want to be able to select the features from a Vector tile layer like in this example - https://openlayers.org/en/latest/examples/vector-tile-selection.html (edit: their tile layer seems to be broken, but it worked fine few days ago). I have a tile…
0
votes
1 answer

How to show dynamic text with gradient style while drawing a circle in openlayers?

I couldn't show text style on circle with "renderer" option in openlayers. I think this renderer option override text style. Is there any way to show text on this gradient style? I am just trying to show radius in meter as title of drawing…
user3565914
  • 51
  • 1
  • 9
0
votes
0 answers

Add controls to ol3-sidebar

I'm trying to add a control-button to one of my sidebar sessions but I don't know how to do that in openlayers. The control I want to put in the sidebar is a printDialog of the 'ol-ext' extension. I'll post the code I tried to use which was one that…
0
votes
1 answer

OpenLayers TileLayer, How to switch between force-on/off and zoom-based visibility?

i have a button to select either: Force Visible Force Invisible Visible between preconfigured Zoom-levels. The doc https://openlayers.org/en/latest/apidoc/module-ol_layer_Base-BaseLayer.html doesn't specify how the visible and min/maxResolution…
Houtman
  • 2,819
  • 2
  • 24
  • 34
0
votes
1 answer

How can I get drawn polygon coordinate in Openlayers?

I have an openlayers project. When I draw the any place in the map, I want to get drawn polygon coordinate and information about drawn place such as neighborhood name. I tried many solution in the here and also another advices but I cant get drawn…
0
votes
1 answer

Removing markers and clear sources not working. The markers remain on the map

I inherited this code of an openlayers map, but I am not able to remove all markers to reset the map and redraw. I added the resetMap function at the end of the file: declare var ol: any; export class OpenLayersService { private markers: any[] =…
Giacomo M
  • 4,450
  • 7
  • 28
  • 57
0
votes
2 answers

Draw multilinestring with ends in OpenLayers

I need to be able to draw a multi-linestring in OpenLayers 5 (this is easy enough) with customizable line ends. For instance if I'm creating a ruler tool I want the ends of the multi-linestring to be a "T" to show precisely where the line starts and…
Funn_Bobby
  • 647
  • 1
  • 20
  • 57