Questions tagged [openlayers-2]

Use this tag when you are using version 2.x of the OpenLayers JavaScript client toolkit.

Filter by
Sorted by
Tagged with
1
vote
0answers
40 views

Distance between points not consistent

I have an Openlayers application where I can input a centre point, width and height in meters from which I can generate a bounding box to display on the map. The problem I'm having is calculating the ...
0
votes
0answers
25 views

OSM and code not re-centering

I am modifying the codes from http://dev.openlayers.org/examples/getfeatureinfo-popup.html and https://www.e-education.psu.edu/geog585/node/783 integrating osm tiles as base map. The modified code ...
0
votes
0answers
25 views

GeoJSON data visible in browser but not showing on map [duplicate]

I am using OpenLayers, GeoServer and Shapefiles. I have published the shapefile to GeoServer and under layer preview I can see JSON data in browser when I select GeoJSON option from the dropdown for ...
0
votes
1answer
143 views

installing arc.js library in OpenLayers not working

I have project developed in Angular 5 with Node.js . Now in my project I want to have flight animation connections and used the example of OpenLayers called 'Flight Animation'. The problem is that ...
0
votes
1answer
178 views

OpenLayers, adding all layers from a WMTS GetCapabilities response?

If I have a WMTS URL, is it possible to feed in the URL and have it automatically add all the layers onto my map instance? Currently, I can replicate the demo, but only if I pass in options, etc. ...
1
vote
1answer
212 views

Drawing point not under mouse cursor

I'm trying to draw on a map using this OpenLayer tutorial. initDrawEvent() { var draw; var source = new VectorSource({ wrapX: false }); var vector = new VectorLayer({ source: source }); ...
1
vote
0answers
69 views

How to get WMS layer feature attribute name [duplicate]

Hereby i have included my WMS layer displaying code.I referred many sites i can't able to get WMS getfeature info.Please anyone help me how to get WMS layer feature info give source code please ...
1
vote
1answer
302 views

Web Map is not displayed in Openlayers with no errors

I want to display a map from a geojson file. Below are my codes. The map didn't show and there were no errors in the console. var urlModev ='maps/StaRita.geojson'; var styles = [ new ol....
1
vote
1answer
3k views

Adding markers using OpenLayers 4

adding markers works fine using OpenLayers 2 but now I need to add markers using OpenLayers 4, how can I do this? my code as follows: var markers = <?php echo json_encode($data)?>; var ...
1
vote
1answer
204 views

gdal2tiles not referencing properly

I'm trying to overlay satellite images in a web page, images are properly georeferenced. When I use gdal2tiles by default it throws an error: gdal2tiles.py --zoom 0-5 --s_srs EPSG:4326 ...
1
vote
0answers
33 views

Did open layers replace the splitWith functionality or just remove it in v3?

I can't find any documentation on what happened to splitWith. It used to belong to ol.geom but was only implemented for linestrings. Does anyone know whether it was removed or replaced and why?
2
votes
1answer
30 views

Openlayers 2 projection different depending on how I ask for it

I have a map and am trying to see what projection is set, but, depending on how I ask, I get two different values, this is what I see in the console: > this.olMap.projection < "EPSG:4326" > ...
0
votes
1answer
161 views

Tranform geometry to WGS 84

I need to transform some line and polygon geometry to WGS 84. At point it working fine, but at the line and polygone I have problems, I tried in many ways, but it does not work. In the screenshot you ...
1
vote
0answers
40 views

OpenLayer - modifying geometry types

I have an openlayer map on the website. I need to draw lines, points and polygons, but after it is draw, the user should be able to change the position of the geometry. In my map it is already done ...
1
vote
0answers
44 views

Openlayers 2 - how to effectively debug rendering failed

When rendering multiple layers on a map, only one layer renders, the last layer in the array when looking at myMap.layers On the layers which don't render, the features which are not rendered are ...
2
votes
0answers
46 views

Is it any way to add more that one OpenLayers.DynamicMeasure?

I would like to make a feature to my webapp, which I could show sum of two(or more) Polygons.. But... When Im drawing another polygon, earlier one disappeared, when I change this.layer.addFeatures([...
2
votes
0answers
99 views

Map markers for OpenLayer map Tiled layers

I need to put some map markers on an OpenLayer map. The map is populated from Geoserver. I have more layers, this is one of it: case "cite:geo_poli_intabulareNouFiltered": var userId = $("...
1
vote
1answer
94 views

Is it possible to catch ServiceException in OpenLayers when ol.Protocol.WFS used?

I have openlayers-2. Can i intercept ServiceException when openlayers make request to GeoServer? I have found this answer, but for HTTP protocol. However in my code is used WFS protocol. Here is how ...
1
vote
0answers
306 views

Geodjango PostgreSQL/PostGIS database question

I have a simple django app using sqlite3. My app is simple I have django user authentication system where the user can be upload spatial raster images and can see that images in user personal HTML ...
1
vote
0answers
225 views

Different image quality for different zoom levels (OpenLayers/GeoServer)?

Original data that raster layers are made of are of a high quality. At a small scale (1:100) this is useful. However at a large scale (1:10 000) it results in ~300KB PNG images which are actually not ...
0
votes
1answer
236 views

How can I get coordinates outside the scope of a function

I am using google maps API in OpenLayers for geocoding so that when I enter an address I can get back the coordinates of this address. I am implementing this with a function but I cannot get the ...
0
votes
0answers
124 views

Saving to database on OpenLayers map changes? [duplicate]

I have put a map on website using OpenLayers. This map is fetched from geoserver by using wms request. and in the same way, it is drawn some shapes such as point, line etc. using open layers library ...
1
vote
0answers
138 views

Dijkstra's own implementation using PostGres & PostGIS [closed]

I'm currently working on a travel routing application and would like to implement my own version of Dijsktras or A*. I've been looking at PostGres & PostGIS for storing OSM data, added using ...
1
vote
1answer
184 views

Unable to Generate Popup with Leaflet From Geoserver

I've been learning to use GeoServer. I found a tutorial: https://www.e-education.psu.edu/geog585/node/765. I followed all of the steps, however the Leaflet map does not generate a popup even when I go ...
0
votes
0answers
138 views

How to convert stylemap with adduniquevaluerules to openlayers 3?

I am new to openlayers. I have following code in openlayers 2. for (var i=0;i<wfslayers.length;i++) { var subteStyleMap = new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ ...
0
votes
0answers
111 views

Equivalence of protocol.http of openlayers 2 to openlayers 3?

I am new to openlayers. I have following code in openlayers 2. for (var i=0;i<wfslayers.length;i++) { var object=wfslayers[i]; var url="/"+object.resourcelocation+"/wfs?token="+object....
1
vote
0answers
79 views

OpenLayers2, trouble with XYZ layer bounds

I have folder with image at server: ex: /folder/zoomlevel(z)/id/x-y.png I added it by the OpenLayer.Layer.XYZ with my getURL() function: getUrl: function(bounds) { var xyz = this.getXYZ(bounds); ...
0
votes
1answer
335 views

OpenLayers 2 loadstart and loadend

I want to add a loading symbol to my openlayers map, which is triggered when a layer is set to load and stopped when the layer is loaded. So I used the event listeners loadstart and loaded. Here is my ...
0
votes
1answer
209 views

How change axis/coordinates/xy order for a particular layer in a Map?

Currently WMS requests are like: ....&BBOX=minX,minY,maxX,maxY&.... I need one layer to have this order: ....&BBOX=minY,minX,maxY,maxX&.... ... while remaining 99% of the map ...
1
vote
0answers
60 views

OpenLayers 2 Prevent redraw of specific layer

In a map with multiple layers I have one WMS-Layer I do not want to redraw on normal map-interaction (zoom, pan). I want to initiate the redraw after a XMLHttpRequest. How can I prevent the redraw for ...
0
votes
2answers
527 views

Get features inside a polygon from a WMS Layer in OpenLayers2

i have found some answers for this and that and the most promising approach seems to be this one here: OpenLayers - Get features inside a polygon But i have no clue how to rewrite this to suite a ...
2
votes
0answers
106 views

Display multiple pop-ups when superposition of polygons with Openlayers

I have a map with polygons vector objects. Superpositions can exist between the polygons. That is to say a bigger polygon is sometimes completely above a smaller one. With Openlayers, is it possible ...
2
votes
1answer
135 views

Openlayers 3 equivalent of render intents of OpenLayers.Stylemap?

I want to convert my openlayers 2 features to openlayers 3. I have following part in openlayers 2. I need an equivalent of StyleMap in openlayers 3 so that I can distinguish the default action and ...
1
vote
1answer
585 views

Simple Website to show WMS with Openlayers

i want a simple website to show a WMS and want to use Openlayers. I started with Quick Start from Openlayers newest version, but got errors. So i took an old workspace (openlayers version 2) and ...
1
vote
1answer
746 views

Create marker icon based on HTML code for OpenLayers

Is there any way that I can create a marker in OpenLayers with an HTML icon? Example in Mapbox: marker.setIcon( L.divIcon({ className: 'map_primary_marker_container', ...
1
vote
0answers
142 views

How to load point on map on change of input value

I am new in OpenLayers. I am trying to map my address location on map by pointing. So I have one input field on change of input field I will get latitude and longitude value and then I will store that ...
3
votes
0answers
74 views

Allow user to pan after once 'box' is draw in Openlayer2

I am using this example http://dev.openlayers.org/examples/draw-feature.html to draw a box on a map using 'draw box' checkbox option. Now I want , After drawing box I can be able to pan on map ...
0
votes
1answer
260 views

embed OSM and Google Imagery in a WebGIS

I've tried to add a google "hybrid" layer as a base map layer in a webGIS... The script is in js and is like this : (I only post this part of the code) { _layer:new OpenLayers....
1
vote
0answers
88 views

Unable to pan on map on a specific zoom level . Openlayers2 [closed]

I am fixing bug of a big application, In which after I cant pan over map but after zoom in I can pan. after again zoom out Its impossible. As I mentioned its big application so I cant post all code ...
1
vote
1answer
540 views

Using multiple Openlayers.Control.SelectFeature controls?

I am working with Openlayers 2. The problem that I am facing right now is that I have multiple editable layers in my application I want to add, delete, modify features as well as Displaying Feature ...
1
vote
1answer
214 views

OpenLayers.Layer.XYZ not referencing tiles correctly

I have tiles stored here: ../CO_054/MtViewBaseMap/MtViewBaseTiles in the order : C:\Program Files (x86)\GeoServer 2.10.3\webapps\CO_054\MtViewBaseMap\MtViewBaseTiles\0\0\0.png I'm using this to ...
2
votes
0answers
135 views

Map is blurry when mobile viewport is set

we are creating a map using openlayers 2. It is working fine on PC, but on mobile devices map looks blurry. I also tried using incognito mode but I get same result, so there is no problem with cached ...
0
votes
0answers
121 views

How to overcome a map distortion when I am changing the angle in Qgis?

In this project I needed to change the map orientation in 90 degrees. I used a nice plugin "Dockable MirrorMap" that gives the opinion to change each layer separately. The problem is that the map ...
0
votes
1answer
445 views

Get coordinates from a drawing point using OpenLayers 2

I implemented a drawing feature (OpenLayers2) on an OpenStreetMap. I searched about how to get coordinates from a drawing point. But I'm still stuck at this point. I tried this code in order to get ...
1
vote
1answer
135 views

OpenLayers - referenced basemap not rendering

I am doing a walkthrough using OpenLayers through a UPENN course where the students are instructed to point to a school sponsored url that hosts a repository for their work. Their respective ...
2
votes
0answers
184 views

How to configure tilestache.cfg “projection”?

I am using tilestache-1.51.6 and mapnik 3.0.9. The tilestache.cfg is { "cache": { "name": "Disk", "path": "/var/www/cachedata", "umask": "0000" }, "layers": { "test": { ...
2
votes
0answers
93 views

OpenLayers 2: Can I delete vector layer or change its z-index when mouse hover on it?

I am adding two vector layers. this.mapport.vector = new OpenLayers.Layer.Vector(); this.mapport.inside_vector = new OpenLayers.Layer.Vector(); map.addLayer(this.mapport.vector); map.addLayer(this....
1
vote
0answers
117 views

Transforming to WKTLine using JSTS library is very slow

I have a performance issue with JSTS library. When my OpenLayers.Geometry.LineString has more than 1000 components (OpenLayers.Geometry.Point), transforming theses points with the JSTS library is very ...
0
votes
1answer
73 views

Highlight radius in OpenLayers 2

I want to create a highlight control which will highlight a line, it should highlight the line when the cursor is near this line (e.g. ~10px) and when cursor is pointing to line. I have following code,...
1
vote
0answers
95 views

Drawing GML data in OpenLayers2

I have a simple application that uses OpenLayers 2.13.1 to draw GML data pasted in a text box. There is already some default GML preloaded in textarea and it works fine. When you press "Add feature" ...