Questions tagged [openlayers]
Use when the version you are using of the OpenLayers JavaScript client toolkit is 3 or later
3,630
questions
0
votes
1
answer
425
views
Adding Vector Data - WFS - can't add multiple features
I'm trying to add features to my OpenLayers map, by querying a publicly available WFS server which serves GML data.
// initalize the map
var map = new ol.Map({
layers: [
new ol.layer.Tile(...
0
votes
1
answer
515
views
How can I return z/x/y of all tiles with OpenLayers3 and export them as geojson or csv?
My custom tile layer:
var baseLayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'http://path/to/the/tiles/base/{z}/{x}/{-y}.png'
})
})
How can I return z/x/y numbering for one ...
0
votes
1
answer
2k
views
Editing wfs layer
I've tried replicating tutorial on how to edit WFS with OpenLayers(https://medium.com/@goldrydigital/wfs-t-with-openlayers-3-16-6fb6a820ac58) but with my own WFS layer from Geoserver. Need some ...
0
votes
1
answer
537
views
Openlayers 3.18.2 displays shifted gdal2tiles output
We are producing tiles from a geotiff using gdal2tiles.py (GDAL 2.1.0dev) to feed a web-system we are developing. We use openlayers 3 (v3.18.2) on the web-system. The gdal2tiles.py by @Klokan ...
0
votes
1
answer
534
views
Get all Geometries Openlayers3
Wondering if anyone knows how to get multiple geometries of what a user has drawn on an openlayers 3 map.
At the moment i am using
var coords = feature.getGeometry().getCoordinates();
Is ...
0
votes
1
answer
2k
views
Remove Interactions and Clear Vectors Openlayers3?
I have a simple mapping application that allows a user to select a draw type eg polygon or point and then draw shapes on the map.
I have to use buttons instead of a dropdown list to select the draw ...
0
votes
1
answer
476
views
OpenLayers maximum DPI
OpenLayers.DOTS_PER_INCH (DPI) can be set to a value the developer chooses. Its default is 72 (from what I have researched) my question is, is there a maximum DPI that OpenLayers can be set to?
0
votes
1
answer
506
views
Openlayers 3 feature-driven rotation
I want to set the rotation of an ol.style.Icon to a given feature property. See line 12 of this:
var styleCache_airports={}
var style_airports = function(feature, resolution){
var value = ""
...
0
votes
1
answer
2k
views
Styling circle with radius depending on GeoJSON property in OpenLayers 3?
I want to represent the weight of each point of my geojson collection by a circle with a scalable radius.
Here an sample of my GeoJSON file:
"features": [
{ "type": "Feature", "properties": { "id": ...
0
votes
1
answer
295
views
How to get geojson WFS to run faster
I use geoserver + openlayers. The problem is that WFS geojson layer has over 10000 objects and when i'm trying to see the map through web-browser it works very slow and laggy. How can i speed it up?
0
votes
1
answer
249
views
Openlayers timezone symbolizer
I have my openlayers-based website, and we are planning to add a timezone map. We want to show a clock with the current time on top of each area. Is that even possible with Openlayers and Javascript?
0
votes
2
answers
356
views
Google map Integration with openlayers 3 features displacement error on map zoom and drag
If I add google map as in this link (http://openlayers.org/en/v3.0.0/examples/google-map.html), when I zoom or drag the map, features also displacing from their position and coming back to its actual ...
0
votes
1
answer
306
views
Openlayers 3 polygon-feature "collision"?
I am currently building a webapp using openlayers 3.
I build in "GPS-tracking" as a features and I got some questions with that.
So, is it possible to run a function if a GPS-Position as a point-...
0
votes
1
answer
2k
views
OpenLayers 3 / Geoserver - add popup w/ attributes to Image layer?
I have a web app using OpenLayers 3, with several layers added as image layers, like so:
mylayer= new ol.layer.Image({
source: new ol.source.ImageWMS({
url: 'http://server/geoserver/...
0
votes
1
answer
224
views
Making flood layer geojson into single featurev like ST_collect in PostgreSQL in openlayers 3 with JSTS?
I have read one geojson file using JSTS now all my features in the geojson file are comming as individual features. Now I want to convert all features into one collected feature like in postgres ...
0
votes
1
answer
2k
views
errors occur while adding features with openlayers3
I'm using openlayers v3.17.1 along with OSM Server as tile server.
I got errors when I called vectorSource.addFeatures with the parameter Array containing more than about 10 features.
Error Info: ...
0
votes
2
answers
86
views
Problem in OpenLayers 3 with mapserver-cgi
I want to form a map using mapserver-cgi, but it does not fit the basemap (OSM).
msLayer = new ol.layer.Image({
source: new ol.source.ImageWMS({
url: 'http://localhost/cgi-bin/mapserv?mode=map&...
0
votes
1
answer
224
views
TypeError for openlayers3 measure example of area
I have got the typeerror for the
1. TypeError: helpTooltipElementa is undefined
2. helpTooltipElementa.innerHTML = helpMsga;
I have defined the helpTooltipElementa in the code even though i am ...
0
votes
1
answer
2k
views
How i compare two objects ol.geom.Polygon?
I have two objects ol.geom.Polygon and I need to compare if this two objects are equal. For example if this objects have the same coordinates, these objects are equal but if the coordinates are ...
0
votes
1
answer
1k
views
How to add drawing over an OpenLayers 3 map?
I am new to OpenLayers 3. I am trying to learn how to draw and save data over an OpenLayers map. Following an example, I am trying to learn about drawing and saving data. However, I am unable to draw ...
0
votes
1
answer
1k
views
Openlayers - MapQuest
We are using mapquest tiles(ol.source.MapQuest) in our application. But, mapquest team is discontinued to access their tiles from 11th July, is there any open source alternative to use instead of ...
0
votes
1
answer
372
views
WMS routine gives error
I am having this error message from ol3-wms(-Geoserver) routine:
Uncaught TypeError: Cannot read property 'closure_uid_477334679' of undefined ol.js:17
Uncaught TypeError: Cannot call method 'hf' of ...
0
votes
1
answer
277
views
Creating linestring layer in epsg:3857 from geojson data in 4326
In OL3, I am confused about creating linestring layer in epsg:3857 from geojson data in 4326.
What should I do?
0
votes
1
answer
3k
views
How can I create a circle feature that will have a constant radius in pixels even on zoom in and zoom out? [closed]
Creating SVG icons have also solve it with much greater flexibility:
var svgXmlCircle = '<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" ' +
'xmlns:xlink="http://www.w3....
0
votes
1
answer
879
views
OL3+osrm show route with instructions [closed]
Could someone give me example how to create a route between two points using ol3 and osrm and give me the instructions (ex in 500m right etc).
I found this already of documenation: https://github.com/...
0
votes
1
answer
219
views
ol3-cesium can't see Globe
I downloaded release ol3-cesium on my computer from https://github.com/openlayers/ol3-cesium/releases/ and when I open examples from the folder it doesn't show 3D globe or vector data. When I open ...
0
votes
3
answers
3k
views
openlayers extent intersects is not working properly
I am using
ol.extent.intersects(extent1, extent2)
to check for intersection between layers and polygon I drew, but it doesn't get me any intersection which is weird because I draw the polygon ...
0
votes
1
answer
2k
views
Gettings multiple features at pixel
I got an app to do there is a map and lots of points which represent a pictures, for example i got 3 pictures in 1 coordinate, and other pictures has other identical coordinates. But now i need once i ...
0
votes
1
answer
1k
views
Using WFS from Geoserver in OpenLayers
There are quite a few questions regarding the subject but the fact that these have so many views makes me think it's a much more complex subject that requires more attention.
I've been through the ...
0
votes
1
answer
1k
views
How to put image on top of OpenLayers 3 map by pixels
I need to put image which should be in middle top of openlayers 3 map. So, it should be defined with map canvas and pixels. Is that possible to do? This is my code:
var arrow = new ol.layer.Image({
...
0
votes
3
answers
1k
views
How can i use WFS in Openlayers 3 with mapserver and PostGis?
I didn't find a documentation to display features ( vectors ) combining
MapServer ( mapfile ) and PostgreSQL/PostGIS and OpenLayers 3 ?
0
votes
1
answer
794
views
Equivalent of OpenLayers 2 ol.Layer.Text in ol3 (to show POIs)
I have this OpenLayers 2 code that I want to convert to OpenLayers 3:
var pois = new ol.Layer.Text(
"My POIs",
{ location:"/media/pois.txt",
projection: ...
}
);
map.addLayers([
...
0
votes
1
answer
33
views
Simply trying to add another layer to openlayers3 script
I'm simply trying to add new layers with each as their own variable so I can turn them on and off, instead of just stacking all the layers under the variable layers.
See script below
<script>
...
0
votes
1
answer
1k
views
OL3 check constrain point drag to lineString?
I am wanting to allow the user to be able to drag a map marker, in OpenLayers 3, but constrain the dragging to the lineString that represents the route. Based on the code example on Stack Exchange I ...
0
votes
1
answer
1k
views
How to call the GeoJSON dynamically according to area selection in OpenLayers 3
I'm trying to get GeoJSON according to the selection of a particular area. For example, if I have selected a built up area it will only show that area . I'm calling GeoJSON data through a PHP page, ...
0
votes
1
answer
248
views
WMS of Geoserver SQL view shows nothing, however WFS works properly [closed]
I am using Geoserver to create a WMS service to serve data out of an SQL Server database. Everything works fine (WMS & WFS) untill I create an SQLView in Geoserver.
The SQLView:
SELECT *
FROM ...
0
votes
1
answer
1k
views
How to implement Shortest Path in Openlayers 3 and Geoserver 2.8.2?
I've managed to get all the SQL queries necessary to get the shortest path with Dijkstra using pgRouting, but now I want to implement them in my website using OpenLayers 3 and GeoServer 2.8.2
The ...
0
votes
1
answer
1k
views
Updating/refreshing/redrawing vector layer in OpenLayers?
I am creating a layer groups with:
var vectorSource = new ol.source.Vector({
features: (new ol.format.GeoJSON()).readFeatures(geoJson, {dataProjection: 'EPSG:4326', featureProjection: '...
0
votes
2
answers
3k
views
OpenLayers 3 custom tileSize
I want to change tileSize from default 256 to 512. I am using WMS version 1.1.0 so i cannot add WIDTH and HEIGHT parameters directly to source.
There are some examples where custom tileGrid is ...
0
votes
1
answer
782
views
OP3 get VectorTile attributes
I am trying to access a VectorTile layers attributes in Openlayers3 like this example. The layer is being server by 'Chubbs'
The layer:
var observationLayer = new ol.layer.VectorTile({
source: ...
0
votes
1
answer
2k
views
Display geojson on WMS images in openlayers 3
Here actually am trying to achieve multipolygon on wms layer in openlayers 3. In this i'm calling a php file which is giving the output of geojson format but i don't have any idea where i'm doing .
I ...
0
votes
1
answer
241
views
Problem with projection in OpenLayers3
I would like to add polygon geojson in the EPSG:2178 projection. The polygon should be displayed in central Europe but I see my geojson in Asia.
Where have I made a mistake? Where can I find ...
0
votes
2
answers
1k
views
Pass sld env parameter with openlayers 3
Is there a way to pass sld env parameter with openlayers 3?
It works to pass the env parameter with a normal getmap-request. Doesn´t openlayers support the env parameter?
I used this example http://...
0
votes
1
answer
519
views
How to get a Line string in OpenLayers 3?
I am using the code to get line string feature.when ever i am using coord2 array i am getting correct line string but whenever i am using points array i am not getting correct line string .I have ...
0
votes
1
answer
1k
views
Image size posted from OpenLayers 3 to MapServer
I have the following map file
MAP
PROJECTION
"init=epsg:4326"
END # PROJECTION
FONTSET "H:/mapserver/data/fonts/fonts.list"
EXTENT 19 33 30 42
IMAGETYPE "png24"
NAME "airways"
SIZE ...
0
votes
1
answer
846
views
OpenLayers 3 modify interaction and featureover
What is the best way to add a 'featureover' event on top of an ol.interaction.Modify ?
At the map or layer level, this event is masked by the interaction.
The 'modifystart' event is fired when the ...
0
votes
1
answer
1k
views
Linestring in OpenLayers doesn't draw
I don't understand why my code doesn't work. If the map is displayed, the line is never drawn:
<script>
var long_deb = -1.28627;
var lat_deb = 43.49829;
var long_fin = -1.29394;
var lat_fin = ...
0
votes
2
answers
1k
views
Can' update a WMS-source with changed params (updating cql-filter) in OL3 / Geoserver
I'm updating a WMS-Layer in a OL3-Map.
I tried to reload the wms-layer with updated clq_filter-params.
Can anyone correct my code or give me a working example?
// initialize filtervariable to show ...
0
votes
1
answer
321
views
Use QuadTree for better complexity on search features
I want to improve the complexity of search specific feature when using this function :
map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
// Do something..
});
The improvment ...
0
votes
2
answers
3k
views
how to draw coordinates along the lanes using MultiLineString instead of LineString
I trying to draw lines along the path of the lanes on the map using openlayer3 but i am not getting any lines on the lanes there is no error in the developers console as well
<!DOCTYPE html>
&...