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
8
votes
2 answers

OpenLayers 3 Reload Layer(s)

I am working on a project using OL3 in which I need to be able to manually (by button press) or automatically (time based) reload vector layers IF they have been updated since the last load using HTTP conditional GETs (304 headers and such). I…
user2395126
  • 526
  • 1
  • 7
  • 20
8
votes
1 answer

Transforming coordinates of feature in openlayers

I want to transform the coordinates for an entire feature in openlayers. I have had success using ol.proj.transform to transform a single coordinate to a different projection, but is there any function that you can feed an entire feature, and all…
Stephen Fricke
  • 163
  • 1
  • 2
  • 12
8
votes
1 answer

How to get Feature which is snaped by ol.interaction snap?

I used ol.interaction.snap but i want to get feature which point was snaped? snapInteraction = new ol.interaction.Snap({ source: Source.stationSource }); because of no event i can not get which point is snaped
梅白帆
  • 89
  • 1
8
votes
1 answer

OpenLayers 3 Stroke style

I want to modify style of the method select . I'm able to change the style of this method but i'm not able to duplicate the white border of blue stroke. Someone is able to style vector with a stroke and put a border to the stroke? See this example,…
FatAl
  • 859
  • 1
  • 6
  • 20
8
votes
6 answers

How to add Google basemaps in openlayers-3?

In openlayers-2, we can add google basemaps(satellite,physical,hybrid,etc.). I need to add google basemaps in openlayer-3. How can I add google basemaps??? CODE in openlayers-3 map = new ol.Map({ layers: [ new ol.layer.Group({ …
shrestha
  • 243
  • 1
  • 4
  • 13
8
votes
5 answers

Formatting the MousePosition control output in OpenLayers 3

I'm showing the mouse position in OpenLayers 3 with the following control var mousePositionControl = new ol.control.MousePosition({ coordinateFormat: ol.coordinate.createStringXY(2), projection: 'EPSG:4326', undefinedHTML:…
sfletche
  • 47,248
  • 30
  • 103
  • 119
8
votes
2 answers

Drawing an OpenLayers 3 map in a hidden element

I am writing a page where you can view both details about an area and a map. The details are on one tab and the map on another. The relevant portion of the HTML is below and the classes are from Bootstrap.
7
votes
1 answer

Open layers maps, with longitude and latitude get address

I am trying to get address(City, Post code,Street address) with longitude and latitude but i don`t know how. I am using Open layers and when i click on part of map a get longitude and latitude of that position. Does anybody have solution for…
Filip Filipovic
  • 410
  • 3
  • 13
7
votes
2 answers

How to filter layers using forEachFeatureAtPixel method

I'm having hard time figuring out how to filter layers using forEachFeatureAtPixel method. I was going trough documentation but without any success so far. I basically want to filter layers and apply overlay style on event (for example "click") or…
Svinjica
  • 2,389
  • 2
  • 37
  • 66
7
votes
2 answers

How to zoom map programmatically Openlayers 3?

I want to draw a square around a marker. if I draw a large square the map should zoom out automatically so that we can see the square completely. If I draw a small square the map should zoom in automatically to show the square completely. In this…
Nelson
  • 89
  • 1
  • 1
  • 6
7
votes
1 answer

Load debug version of pre-built module via npm/webpack

There is a javascript library, pre-built and available on npm, that I wish to develop with/debug. In my case, it is openlayers. In the classic way of requiring a javascript file and wanting to debug, one would just switch the script url from the…
7
votes
2 answers

Openlayers 3 feature label position relative to size of feature?

I have several layers on an OL map which contain outlines, background colours and labels for the same sized features, so you can show or hide one or more of the layers. Two of these layers are just labels... the style contains no fill or stroke. One…
Helen Danger Burns
  • 421
  • 2
  • 9
  • 28
7
votes
1 answer

How to position a static image overlay on top of OpenLayers 3 Map

I am using OpenLayers 3 to display indoor maps in an Angular/Ionic mobile app. The maps are static images that I am placing on top of the OpenLayers map. I am creating the map and adding the image layer like below. var extent =…
Wes Cole
  • 71
  • 1
  • 4
7
votes
3 answers

Openlayers 3. How to make tootlip for feature

Now I'm moving my project from openlayers 2 to openlayers 3. Unfortunately I can't find how to show title (tooltip) for feature. In OL2 there was a style named graphicTitle. Could you give me advice how to implement tooltip on OL3?
Anton Anton
  • 191
  • 1
  • 1
  • 6
7
votes
3 answers

Using openlayer3 in typescript/angular2

I have a Javascript code which use openLayer3. I need to implement this code in a angular2 project, in Typescript. Someone knows how use openlayer with angular2 / Typescript please ? Thanks a lot, John
Azylaans
  • 981
  • 8
  • 18