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
12
votes
4answers
17k 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
12k 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 ...
7
votes
5answers
5k views

Using OpenLayers Selectfeature get mouse position? [closed]

How do I get mouse coordinates after a SelectFeature, which returns the feature by itself?
5
votes
3answers
3k 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 ...
13
votes
3answers
43k 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
19k views

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 : ...
9
votes
2answers
12k 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
2answers
18k 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: '...
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. ...
5
votes
5answers
1k 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
10k 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 ...
6
votes
1answer
21k 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: [ ...
5
votes
4answers
10k 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
1answer
12k 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?
3
votes
2answers
19k 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 ...
3
votes
3answers
3k 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 ...
2
votes
2answers
2k 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
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 ...
9
votes
3answers
20k 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 ...
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
1answer
3k 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
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 ...
4
votes
2answers
1k 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 ...
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
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
7k 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
12k 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 ...
3
votes
1answer
7k 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
1answer
4k 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
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
47 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

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:...
2
votes
1answer
6k views

OpenLayers HeatMap add customized data

I want to add HeatMap customized data based in a vector (longitude, latitude, temperature). Currently I have this code: data = new ol.source.Vector(); map = new ol.Map({ target: 'map_canvas'...
2
votes
2answers
2k views

Adding image links in GeoJSON object to get images in popup using OpenLayers 3?

I have added a geojson file on my map. By clicking on a geojson feature I am getting a pop up which is displaying geometry and coordinate values. Now I want to display image in a pop up also. How to ...
2
votes
0answers
55 views

Make Mollweide oval

On base of this this thread i have a map with xyz-tilelayers in Mollweide projection. Now, the tilelayer is presented in rectangular form, parts of the world are duplicated and presented in a very ...
2
votes
1answer
4k views

OL3 how to get WKT representation of a Polygon

I have a vector layer in OpenLayers 3 that I want to export to a shapefile, I take the geometry of the polygon. In an attempt to fix an issue with my WKT (see this question) I add the first ...
2
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
1answer
1k views

Adding multiple OpenLayers Vector Layer markers with data parsed from JSON file?

I would like to parse a local JSON file and add markers to a map based on the latitude and longitude parsed from the JSON file. Here is a sample from the local JSON file: "LOCATION_A": { ...
2
votes
1answer
10k views

OpenLayers 3 restrict map to an area

I want to restrict the OpenLayers 3 heatmap-earthquakes examle to show only Europe. I have: var raster = new ol.layer.Tile({ source: new ol.source.Stamen({ layer: 'toner-background' }) }); ...
2
votes
1answer
2k views

OpenLayers 3 dynamically add layer from folder contents

I am new to OpenLayers and have searched far and wide trying to figure out how to programmatically add layers with a default set of parameters from a selected source path, but Google has not produced ...
2
votes
2answers
5k views

Access-Control-Allow-Origin in geoserver and ol3

I am using OL3, Geoserver. I made a website with Asp.net and add map with OL3. which is get data from geoserver with WFS. my website is located in C:\programfile\geoserver\www\mysite. Also config IIS ...
2
votes
3answers
8k 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 = ...
2
votes
2answers
670 views

OpenLayers 3 / Cesium polygon projection issue

I am using OpenLayers 3 and Cesium (via ol3-cesium). I have created a few rectangles (using a MultiPolygon) stacked on top of each other. Whereas in OpenLayers the rendering (left) is as expected, ...
1
vote
1answer
4k views

How to set the URL from an icon in OpenLayers 3?

I've tried to set the URL from an icon but without success. In fact, I've been searching in OpenLayers API but I haven't seen any method to set it. In OpenLayers 2 I've seen that It's possible. I ...