Questions tagged [openlayers-3]

OpenLayers 3 is the complete rewrite of the OpenLayers 2.x mapping library, targeting modern features of HTML5 and CSS3. It is not compatible with OpenLayers 2. OpenLayers is completely free and open source, having been released under the 2-clause BSD License.

OpenLayers 3

OpenLayers 3 is a high-performance, feature-packed library for creating interactive maps on the web.

Beginners may wish to consult the following resources:

Usual search keywords are 'OpenLayers' and 'ol'.

Source code can be found on GitHub at https://github.com/openlayers/openlayers.

Tag usage

Use of the tag was encouraged by OpenLayers developers for questions specific to OpenLayers 3, but it no longer is. The tag will probably get more attention.

2413 questions
0
votes
1 answer

Feature Labels Disappear at Lower Zoom Levels, I want to force them to always appear

What controls whether or not a feature label will display? I would like to force the feature labels to display regardless of zoom level and relative distance to another feature. There is some magic happening behind the scenes that makes the labels…
Jonathan
  • 894
  • 2
  • 9
  • 20
0
votes
0 answers

Point drawn as icon on open layers appears to change position w.r.t cordinates on zoom in and out

I am working on displaying a point on the map as a image using open layers. I have used the following code to provide styles to the feature. function getSvg(color){ var color = "fill:"+color; return '
Shijil Narayanan
  • 1,011
  • 8
  • 21
0
votes
1 answer

How to make the text feature continue to follow the iamge feature to move in real time after being translated to a new location in openlayers 3?

When adding an airplane to the map, the airplane picture and the airplane number appear. The airplane number is offset above the airplane picture.The position of the aircraft picture and the aircraft number is updated and changed in real time. There…
sueRimn
  • 21
  • 6
0
votes
1 answer

How to adjust overlay on polygon to left and right in openlayers

I have openlayers map with a polygon feature. When we hover over the polygon, it displays the description in overlay. However the overlay is always displayed on the polygon and not to left and right which is what I am trying to do. In doing so I…
capnam
  • 429
  • 9
  • 25
0
votes
1 answer

Openlayers not re-projecting WMS queries

I have an openlayers map in my project and I wanted to add WMS tiles to it. This is my code : const map = new ol.Map({ layers: [ new ol.layer.Tile({ name: 'wmstiles', source: new ol.source.TileWMS({ url:…
Qrom
  • 487
  • 5
  • 20
0
votes
1 answer

OpenLayers Multi-line drawing lines disappear

Normally the code draws by calculating the linestring that will occur in every map movement. But the lines drawn in a certain convergence disappear. In the sample code, the green line is the main line and it does not disappear, but the lines outside…
Onur Ek.
  • 69
  • 1
  • 1
  • 8
0
votes
2 answers

getFeaturesAtPixel() to include decluttered (hidden) features

Is there any way to get all the features in one layer at one specific pixel, including the hidden ones due to decluttering? Currently, when calling Map.getFeaturesAtPixel() (or Map.forEachFeatureAtPixel()) those features are omitted.
Ricardo
  • 180
  • 2
  • 12
0
votes
1 answer

OpenLayers 4.6.5 Setting a feature colour

So I'm trying to set a feature colour like so, addInteraction() { this.style = new Style({ fill: new Fill({ color: this.fillColour, }), stroke: new Stroke({ color: this.lineColour, width: 2 }), …
Munerz
  • 1,052
  • 1
  • 13
  • 26
0
votes
1 answer

How can i add a geojson file using it's local path with openlayers?

I want to load a local geojson to my map using openlayers. Here is what I currently have: var gjsonFile = new ol.layer.Vector({ source: new ol.source.Vector({ format: new ol.format.GeoJSON({ }), url:…
Meryem
  • 63
  • 6
0
votes
1 answer

How do I create a distance scale ring in SVG in openlayers 3?

I want to draw an SVG distance ring on one of the layers in openlayers 3, centered around the center of the screen.Draw each ring in screen coordinates. The distance between each ring represents the distance on the map. The distance between each…
sueRimn
  • 21
  • 6
0
votes
1 answer

How do I add a feature to openlayers map hosted on geoserver?

I have a map of one layer displaying countries. It is hosted on geoserver and the layer is stored in my postgis database. I need to be able to allow an user to add other countries on the map for example (just one point is enough). How can I achieve…
Mikael Ken
  • 41
  • 1
  • 10
0
votes
1 answer

Angular - Set form value from inside a clickListener of OpenLayers

I'm trying to set a simple form text field containing the longitute and latitute from inside of a clicklistener of OpenlLayers. As a result I get ERROR TypeError: Cannot read property 'setValue' of undefined Why is this.lat and this.long producing…
Joschi
  • 2,118
  • 3
  • 16
  • 32
0
votes
1 answer

Vector tiles:GetTile WMTS ol.format.MVT() with Openalyer v5.3.0 From Geoserver

I have layers on Geoserver(2.13.0) that configure with MSSQL DataStore.I install vector tile extension for the same version. After installed, while previewing with TileLayers pbf by selection from drop down result is…
cj devin
  • 1,045
  • 3
  • 13
  • 48
0
votes
1 answer

Loading mapbox GL JS basemap style in Openlayers 3

I'm trying to add a customized mapbox GL JS basemap (which has been styled by a coworker) inside existing Openlayers 3 code I have written, though am having trouble finding a solution to having both of these work together. So far I have been adding…
noe.s
  • 13
  • 1
  • 4
0
votes
1 answer

Openlayers 3 : cannot select a feature in an Angular 5 app

I would like to select a feature in Openlayers 3 in my Angular 5 app. Upon clicking on a feature, I get this weird message: core.js:1449 ERROR TypeError: Cannot read property 'call' of undefined I have to use Openlayers3 (and not a newer…
tm1701
  • 7,307
  • 17
  • 79
  • 168