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
2answers
19k views

OSM offline tiles — mbtiles in openlayers

I used tiledownloader to download offline tiles. Now with the new policy acces of mapquest this would be difficult. I found http://osm2vectortiles.org/downloads/ to download some files but they are ...
0
votes
1answer
947 views

Changing visibility of layers on project with OpenLayers and GeoServer?

I'm working on a proyect with openlayers and geoserver, the idea is to have a select menu where the user can choose which layer is visible, something like this <select id="format"> <...
0
votes
1answer
2k views

Request JSONP from Geoserver using AJAX request in Openlayers 3

I am creating a web application using OpenLayers 3 and I am looking to import my vector layers into this. I currently have my data in Geoserver and I am trying to use the following code, but when I ...
12
votes
4answers
18k views

Hosting GeoServer+Openlayers web mapping application on internet? [closed]

I have created a web mapping application prototype using GeoServer (running on Tomcat as the servlet), Openlayers and PostGIS. Since it was a prototype, at that time, i did not bother about the ...
9
votes
3answers
13k views

How to get names of all layers in a store in GeoServer using OpenLayers

I have strict requirement to retrieve names of all layers in a GeoServer store using OpenLayers. I've gone through the post here, but it doesn't answer my question. I've also gone through GeoServer's ...
5
votes
3answers
4k views

How to update location via a data stream in OpenLayers or Leaflet?

I'm developing a application where I need to real-time update a location of a map using a data stream. I'm planing to use web-sockets. Are there any guides I can follow? Or can you direct me in the ...
7
votes
5answers
6k views

Using OpenLayers Selectfeature get mouse position? [closed]

How do I get mouse coordinates after a SelectFeature, which returns the feature by itself?
17
votes
3answers
49k views

Change OpenLayers 3 view center

I'm using OpenLayers 3 to interact with some maps. I first declare my map: map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ ...
9
votes
3answers
20k views

Setting OpenLayers 3 Layer Visibility

I'm trying to upgrade my Openlayers 2.12 map to Openlayers 3 to take advantage of the fantastic transition effects on transparent layers (Something OL2 and Leaflet can't do attractively). This and I ...
4
votes
1answer
5k views

GeoServer, OpenLayers so slow for WFS! Why?

I am displaying 100 000 points in a layer via WFS protocol. I need about 5 minutes. However, 100 000 does not seems so much... My points are stored in PostGIS, in a column defined this way : ...
10
votes
2answers
13k views

How to create circular polygon in openlayers 3?

So i would really like to modify this example: http://openlayers.org/en/v3.0.0/examples/tissot.html?q=circle Problem is that when I try to apply it to my map it doesn't work, probably because I use ...
8
votes
4answers
3k views

Implementing WPS client in OpenLayers 3?

Is it possible (and what is the recommended way) to use OpenLayers 3 to do the work of theOpenLayers.WPSClient? As shown in the old WPS client example, OpenLayers 2 can be used to operate WPS. ...
8
votes
2answers
20k views

Remove selected feature Openlayers 3

I'm using openlayers 3 to create web application that allow to user to draw LineString features in the map. this is the code: var raster = new ol.layer.Tile({ source: new ol.source.MapQuest({ layer: '...
5
votes
5answers
2k views

Openlayers HiDPI/Retina Screen with standard resolution raster tiles?

My Openlayers application can display tiled rasters from arbitrary online sources. It will parse capabilities from any user-specified URL for WMTS, TMS, OSM, XYZ or WMS services and present the user ...
3
votes
2answers
11k views

GeoJSON - how to style features of GeometryCollection

I have a GeoJSON file with a feature as follows: { "type": "Feature", "properties": { "Start Date": "01-09-2015", "End Date": "01-09-2015" }, "geometry": { "type": "...
8
votes
3answers
12k views

How can I use WFS from Geoserver with OpenLayers 3?

I have tried with different setups and formats, but no success. With firebug, I can see that the json data is loaded, but nothing shows up on the map. Have anyone experience with geoserver and wfs ...
8
votes
1answer
24k views

Getting extent in OpenLayers 3?

I am using openlayers3 and i am initializing my map like so: var view = new ol.View({ center: ol.proj.fromLonLat([5.8713, 45.6452]), zoom: 12, }); var map = new ol.Map({ layers: [ ...
7
votes
2answers
1k views

Open layers supercluster integration - is it possible to fetch underlying features for each cluster?

I am using the open layers 3 with supercluster at the moment, extending the example provided here : https://jsfiddle.net/d5gwvz2y/2/ My question is: How does one fetch all the underlying features ...
6
votes
2answers
1k views

Hide old tiles while loading new ones when zooming in Openlayers

Standard behavior, while zooming in and out in Openlayers, is that the current tile gets resampled and displayed stretched or compressed until the new tile is available. That's how it looks like while ...
6
votes
4answers
12k views

Local OpenLayers3 - SVG icon

I have an OpenLayers3 map on my local filesystem, and I want a point layer to use SVG icons. This seems to fail silently: var style = new ol.style.Style({ image: new ol.style.Icon({ size: ...
5
votes
2answers
9k views

How to get current scale in OpenLayers 3

I am new with OpenLayers 3. I'm working with the projection EPSG:4326. I can get current resolution from view.getResolution(), but I am having trouble to get current scale of map. Please, give me a ...
4
votes
2answers
20k views

OpenLayers-3 add geolocation marker

I am having some trouble adding a geolocation marker to my map. I am able to call to the geolocation and center the map on it but I can't get a marker to drop at that location. It should be noted I am ...
4
votes
1answer
14k views

How to set an ol.style.text using a source in OpenLayers?

I have the following code: var cbcWFS = new ol.source.GeoJSON({ projection: 'EPSG:3857', url: 'http://localhost:7070/geoserver/CuerpoBomberosCurico/ows?service=WFS&version=1.0.0&...
4
votes
1answer
4k views

How can I remove a layer from layerswitcher in OpenLayers?

I have several vectors and WMS layers in layer switcher. But I don't need these layers to be displaying in layer switcher. How can I remove these layers from layer switcher?
4
votes
1answer
488 views

Splitting feature in OpenLayers 5?

How do you split an OpenLayers Vector Feature (Polygon or a LineString)? i.e ux: select feature, select a 'split' UI button, draw a split on-top of the polygon or through the line. The feature ...
3
votes
2answers
7k views

Programatically export Openlayers maps to static image file

As far as I understand this example from the OpenLayers page and the linked source code for this example, OpenLayers3 now has the offical ability to save maps as static image files. However, the ...
3
votes
3answers
4k views

How to select features inside polygon instead of inside polygon's bbox(extent) in openlayers 3

ol3 supplies the method forEachFeatureIntersectingExtent which only good for boxes. I have user drawn polygons (or multipolygons) for selecting features from a vector layer. I'm relatively new to ...
3
votes
3answers
10k views

Applying multiple CQL_FILTER to single GeoServer LayerGroup?

I've created a page with OpenLayers 3 that adds a WMS Tile layer to the map served up by a local GeoServer (v2.6) instance. As it stands adding layer by layer things work just fine: var dynamicMap = ...
3
votes
1answer
2k views

Accessing Google Tile independent from their API in OL3 is possible for paying customer?

Using map from tile providers are common use-case in web mapping: overlaying internally-hosted WMS/WFS layer on top of Google Maps/OSM/Bing Maps. These are easy in OpenLayers 2. However, this feat -...
2
votes
2answers
3k views

allow client to upload Layers to Openlayers 3

I want to allow the clients to add vector layers in form of a geojson to openlayers 3. It should look like in this fiddle . I know how to add multiple layers but I want the client to be able to add a ...
1
vote
1answer
2k views

GetFeatureInfo on mouse hover on feature in OpenLayers 3

I am able to get popup onclick on the feature but want to get popup also on mouse hover on the feature (polygon,point). Can anyone help me out. For onclick I used below code - var feature_onClick; ...
12
votes
4answers
24k views

Get Center of Geometry in OpenLayers 3

Given a Geometry object in OpenLayers 3. How would one go about getting its center? Older versions of OpenLayers provided a getCentroid method. There was also a getBounds workaround. But these appear ...
6
votes
2answers
1k views

Using Custom Aerial Raster Imagery with OpenLayers 3 or 4

Currently, openlayers supports bing maps, however this is not an ideal option for a commercial application. What would be ideal is to have the ability to host and serve ariel imagery like NASA blue ...
6
votes
1answer
4k views

OpenLayers 3 how to get only the modified feature?

I have a problem with OL3 and it's ol.interaction.Modify Event. Whenever I modify a feature, just one, it returns all features inside the layer. Currently I have 77 features (polygons) and I can ...
6
votes
1answer
14k views

Draw polygons from an array in OL3

I have an query that produces an array of coordinates like so: 95.61,38.60 95.22,37.98 95.60,37.66 94.97,37.65 (long/lat separated by "," and coordinates separated by a space). How can I use these ...
5
votes
4answers
9k views

Dynamically add layer(s) to Layer Group

I have an Openlayers 3 app and users can retrieve stored routes from a web service and display them on a map. Currently each route is added to the top of the index but I'd like them to be inserted ...
4
votes
1answer
4k views

Draw Rectangle using OpenLayers 4?

I just want to draw rectangle for style. if I do this image: new ol.style.RegularShape({ fill: fill, //stroke: stroke, // offsetY: -25, points: 4, radius1: 30,...
4
votes
1answer
1k views

OpenLayers3 add map to bottom of a layer?

According to OpenLayers 3 documentation, the function addLayer(layer) Adds the given layer to the top of this map. How can I add a layer to the bottom of a map? P.S. I need this to add a ...
4
votes
4answers
5k views

QGIS OpenLayers 3 Google Maps not zooming

Google Satellite will not zoom. Although the scale changes as I zoom, as the map is re-rendered, it zooms out to its maximum extent every time. This first happened in the latter part of November ...
4
votes
2answers
2k views

How would I get number of tiles loaded, and total number loading?

So new to OpenLayers 3, and I'm trying to create a "loading bar" to indicate how much of a layer has loaded. I'm thinking of making it based on the number of tiles loaded so far divided by the total ...
3
votes
1answer
14k views

OpenLayers 3: Access feature by ID

I want to create a map with openlayers, add feature points, let people move the points and retrieve the new coordinates later. I have searched the net for two days but all I found was an example where ...
3
votes
1answer
5k views

How to add a buffer on a point in OpenLayers 3

I am trying to add a buffer around some points shown on a map. I have tried to do something similar back in the days of OL2 and I remember it was not straight forward. Is there a simple way to do ...
3
votes
1answer
3k views

Trigger event once layer is loaded

var pixelProjection = new ol.proj.Projection({ code: 'pixel', units: 'pixels', extent: [0, 0, width, height] }); var layerNC = new ol.layer.Image({ source: new ol.source....
3
votes
1answer
2k views

Why don't set Geometry column in OpenLayers wfs-t request to geoserver?

I want to edit a vector layer(its a point layer) using OpenLayers 3.6 and then save it with wfs protocol. I'm using Goserver 2.8 in server side. I define my layer as follow: var u="http://localhost:...
3
votes
1answer
120 views

Using a projection other than Mercator with proj4js 2.5 and OpenLayers 5.3

I am following the OpenLayers FAQ regarding the use of coordinate systems that do not rely on the infamous Mercator projection. I thus produced a very small HTML with a simple example that could be ...
3
votes
1answer
2k views

OpenLayers Add EventListener for Fullscreen close

I'm currently building a web-app with Angular and OpenLayers. Due to the nature of my site I need to call map.updateSize() when the screen changes size which works as expected. However when I enter ...
3
votes
1answer
2k views

Add image along the LineString

I am wondering how to place images on a line. For example, instead of a dotted or dashed line. I could include a symbol of a cloud a character (e.g. |) repeated along the line. it cannot show the ...
3
votes
2answers
12k views

Load GeoJSON file in OpenLayers 3?

Before, to load my .geojson, I had a php file who generated the code : var vector_limite_comm_white = new ol.layer.Vector({ source: new ol.source.GeoJSON({ url: 'geojson1.php', ...
3
votes
1answer
9k views

Openlayers 3 - Zoom to Selected Feature (Polygon)

I have an ol.source.ServerVector with several polygons drawn as features. I'd like for the map to zoom to the extent of the selected polygon upon selection, but I'm hitting a wall. I was able to ...
3
votes
2answers
2k views

reload ServerVector with different zoom levels in openlaers3

how to reload ServerVector with different zoom levels ? I don't want to use ol.loadingstrategy.createTile strategy because it sends many requests with each zoom -one request with each tile - which ...