Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [openlayers-2]

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

0
votes
1answer
38 views

GeoServer get native SRS of layer

I want to get the native SRS/EPSG-Code of a layer deployed in GeoServer. Maybe similar to this solution: https://stackoverflow.com/questions/32766126/get-the-epsg-code-from-openlayers-3-layer but with ...
1
vote
0answers
13 views

Openlayers 2: [In Touch] Pinch zoom action triggers click event at the end. How to prevent click on pinch zoom

Openlayers 2: [In Touch] Pinch zoom action triggers click event at the end. How to prevent click event registered on map getting triggered when pinch is done
1
vote
1answer
48 views

Openlayers get list of all layers in Geoserver

How can I get a list of all layers deployed in Geoserver separated by Vector/Raster? Similar to how Geoserver itself does this when one uses the WPS Request Builder (it then shows a complete list of ...
0
votes
1answer
18 views

Triggering Events on Drawing Geometries

Which events are triggered when I draw, for example, a polygon? Like when I define the vertices of the polygon by clicking? And how can I capture these events? Or, better: Is there any documentation ...
1
vote
0answers
10 views

Open Layers squished tiles until page zoomed

Upon initial load the map tiles are squished or sometimes do not appear properly as per image below. This is fixed when the page is zoomed in and out (not the map). This is when the page is viewed on ...
0
votes
0answers
20 views

How to select and highlight a WMS feature? [duplicate]

I'am using GeoServer and OpenLayers 2.13 and I want to select and highlight my features in my web application. Is it possible using WMS features and control "OpenLayers.Control.SLDSelect"? I've ...
1
vote
0answers
21 views

Dynamic colouring of SVG-icons in OpenLayers 2

I've got an OpenLayers 2 map with a lot of point features that need to be represented using a number of different SVG-symbols. Unfortunately, the marker icons need to be displayed in different ...
0
votes
0answers
9 views

Mapserver PHP Mapscript Dynamic Heatmap

I am using MapServer 7.0.7 and PHP 5.6.36. I have a layer group in a mapfile which is dynamically generated via PHP mapscript. I would like to add a dynamic heatmap (kernel density) layer based on ...
0
votes
1answer
7 views

scale line distance openlayers 2

Is there a control in Openlayers 2 to show scale similar to the new Openlayers v3/4/5 which displays in ft or miles depending on zoom level? Eventually I will rewrite in OL5, but I'm maintaining ...
0
votes
1answer
40 views

Locating Basemaps in QGIS?

I've been attempting to download a usable basemap for USGS Topography for quite some time. Going through the USGS procedure to acquire the map has not worked to date. Quickmapservices and Openlayer ...
0
votes
0answers
45 views

Weird effect on labeling when WMS layer is hidden in Layerswitcher (Openlayers 2)

I have a WMS layer published with Geoserver. When I try to hide it from the Layerswitcher, by adding the line "{displayInLayerSwitcher:false},", the layer doesn't appear in the Layerswitcher anymore, ...
0
votes
0answers
18 views

OpenLayers 2 - Swap lines on deeper zoom for view port

Having two linestrings, one with overview path, which uses less points and draws incomplete line - Overview path. And then a detailed one where it loads a lot of points for correct route simulation. ...
0
votes
1answer
70 views

How realistic is it to be able to build a dynamic map with ~50k points that change colour depending on supplied data? [closed]

I'm a programmer, but I'm new to GIS. I want to build a map that displays the status of some IoT devices I work with. My ideal vision is a world map, which would fill the screen, but for now, ...
1
vote
2answers
78 views

Adding multiple layers in GeoServer WMS URL

I have a URL that I am passing into an API call to bring back a static image of a map. This URL currently works: http://computername:8080/geoserver/Packt/wms?service=WMS&version=1.1.0&...
1
vote
1answer
3k views

Google maps error in OpenLayers plugin in QGIS

I was using the Google maps on OpenLayers plugin in QGIS 2.16.3 successfully before but today when I tried it the page appears as shown in the figure; I tried re-installing the plugin but this keeps ...
0
votes
0answers
28 views

Openlayers 2 Vector Layer with BBox strategy too large

Currently, i'm building a REST service which will receive the bbox from front-end and then using that bbox to looking for appropriate Geometry Shape in MSSQL database. My Openlayer are setting up ...
0
votes
0answers
34 views

How to create a donut polygon in Openlayer 3

function Draw(coordinat, c) { var geojsonObject = { 'type': 'FeatureCollection', 'crs': { 'type': 'name', 'properties': { 'name': 'EPSG:3857' } }, '...
0
votes
1answer
26 views

Openlayers 2 aand Openlayers 3 Code convertion

I have an old Opanlayers 2 application. And I need to convert an Opanlayers3 code to Opnelayers2, but could not. Opanlaysrs 3 Code var epsg = "EPSG:900913"; var projection = ol.proj.get(epsg); ...
0
votes
1answer
104 views

GeoDjango raster field display on Leaflet

In the new Django version support raster field and I follow this manual for GeoDjango raster field and this question for add raster I have built a simple demo. here the code : settings.py postgis ...
0
votes
0answers
26 views

OpenLayers 2: zoomToExtent with scale

I need to zoom map to show some selected features from layer. So I am creating a temporary layer with features and zoom to this temporary layer. The problem - usually the scale is too small, so I ...
0
votes
0answers
53 views

Adjusting Overlay of Google Satellite Base map and Parcel Boundary

I'm fairly new to QGIS and have bounced back between version 2.18 and 3.2. I've been unable to fix my overlaying issue regardless of versions, openlayers plugin, quickmapservices, and using XYZ tiles. ...
1
vote
1answer
213 views

Basic WMTS example with GeoServer and OpenLayers

I want to set up a local WMTS with GeoServer. There are a couple of example data layers such as 'topp:states' which has the EPSG:4326 projection. I'm using the default configuration of GeoServer and ...
1
vote
1answer
70 views

View my osm file content on a layer

I'm trying to use OSM maps in a simple html page, just to learn the bases and evaluate if it will allow us to represent specific data on a map. Our needs are to have a web map of a specific highway ...
0
votes
0answers
29 views

Snapping another layer point with Create Circle Polygon in Openlayers 2

I want to create Circle polygon but i need to take point for my layer vertex point in using snapping.I don't know how to do it? When i am click on the map the create polygon circle has to be create ...
1
vote
0answers
27 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
34 views

How to Take Circle Polygon Geometry to Line in openlayers 2

When user click on the map circle will be create based on user input radius values. I have to convert circle polygon Geometry to Line. When I am using new OpenLayers.Geometry.LinearRing(pGeometry....
0
votes
0answers
20 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
24 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
0answers
41 views

Openlayers 2 duplicates features

Yes, I know OpenLayers 2 it's too old... but no budget to change it for OL 3. My maps have been working perfectly fine til this month that it started to duplicate features when zooming in. The bug ...
0
votes
0answers
32 views

Clone Openlayers 2 baselayer from another map

var options = { theme: null, resolutions: this.map.resolutions, projection: new OpenLayers.Projection(this.map.getProjection()) }; var newMap = new OpenLayers.Map(div, options); var ...
0
votes
1answer
96 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
84 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
144 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 }); ...
0
votes
0answers
28 views

Adding popup on feature click in openlayers [duplicate]

All I am trying to do is add a popup on feature click in openlayers that will display feature information on click . I have 7 map layers as:- `var one = new ol.layer.Image({ source: new ...
1
vote
0answers
24 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
82 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....
0
votes
1answer
1k 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 ...
0
votes
0answers
36 views

Iterating through all WMT layers in OpenLayers?

I want to hit a WMT getCapabilities endpoint and be able to iterate through all the map layers and add them to my openlayers map that has already been instantiated. Is it possible to do this in ...
0
votes
0answers
15 views

Buffer created around points. Now I want select the points out that interact with another layer

I have created a map with GPS data points that represents power plants. I have created buffers around those points that represents 25k a radius. I have added another layer to the map that represents ...
1
vote
1answer
100 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
30 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
27 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
96 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
21 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
31 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
23 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([...
3
votes
0answers
78 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
66 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
281 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 ...
0
votes
0answers
9 views

The wms layer from geoserver drifts away on zoom in and out [duplicate]

Does anyone know why there is a shift and how we can resolve it in Openlayers2? I am using openlayers 2.11 and geoserver 2.2.4 if that matters! The wms layers I receive from the geoserver and overlay ...