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
29 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
36 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
15 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
64 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
50 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
971 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
24 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
27 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
19 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
64 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 build a simple demo. here the code : settings.py postgis ...
0
votes
0answers
20 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
43 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
103 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
59 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
23 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
24 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
31 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
33 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
26 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
72 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
61 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
114 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
18 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
19 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
32 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
0answers
982 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
30 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
14 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
80 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
27 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
84 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
19 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
29 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
20 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
73 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
59 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
257 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 ...
1
vote
0answers
146 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
85 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
48 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 ...
0
votes
0answers
117 views

The overlays div with class datalbls in Openlayers layer switcher,disappears when I select baselayer. How can the overlays always be visible?

I am new to openlayers and am unable to understand why my overlays div which I created in div type layer switcher disappears when I change my baselayer. I am using Jquery to add the overlay div. How ...
0
votes
0answers
28 views

How to test if OpenLayers 2 have finished redrawing a layer?

I am calling wmsLayer.redraw(true) on a WMS layer and would like to be able to tell the user that layer was redrawn. From http://dev.openlayers.org/apidocs/files/OpenLayers/Layer-js.html#OpenLayers....
0
votes
0answers
59 views

Openlayers 2 and Google Maps overlap problem

I have a map app with Google map under the WMS layer.All layers projection is EPSG:3857 and its perfectly work with Bing Maps. But with Google Maps, I have a weird problem. While I pan my map, wms ...
0
votes
0answers
54 views

Cannot click on any feature of point shapefile in openlayers 2

Given below is my code for creating a vector layer and then selecting different features of vector layer. This code works perfectly for the shapefiles that are in "polygon shape". Eg: I can select any ...
1
vote
0answers
96 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 ...
0
votes
0answers
80 views

Openlayers 3 Clustered layer color by property

I have clustered layer strategy function like this. (openlayers 4) function clusterStrategy(features) { var style = function (feature) { var styleCache = {}; var size = feature....