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
1answer
334 views

How to get two lat-lon points in JSP to find shortest path on click of OpenLayers map

I'm using GeoServer, PostgreSQL and here OpenLayers. I'm trying to retrieve two lat-lon points (for point A and point B) on clicking of map. This code is working only to retrieve one lat-lon. I ...
10
votes
3answers
2k views

In what coordinate systems do true circles appear round?

I have been developing in Google Maps for awhile and am switching to OpenLayers but am stuck on one point: I am drawing vectors that are mostly circular but also involve some custom geometry so I can'...
0
votes
1answer
600 views

Legend in GeoExt.tree.LayerContainer

Using the code below in this jsfiddle example: tree = new Ext.tree.TreePanel({ renderTo: "tree", root: new GeoExt.tree.LayerContainer({ text: 'Map Layers', ...
-2
votes
1answer
33 views

Local coordinates in NoSql database

Is there any nosql database which supports the below 1) Should support local coordinates (spatial data which holds the coordinatesof door, Infra, etc.) 2)Integration with Geoserver.
1
vote
2answers
767 views

Removing custom controls?

I am trying to remove custom draw controls from my OpenLayers application which I create like this: var drawControls = { polygon: new OpenLayers.Control.DrawFeature(polygonLayerFreehand, ...
0
votes
1answer
32 views

How to change tileSize in XYZ from default([256,256]) to something else for openlayers?

I am trying to change the tile size and I have not been able. Below is the code. var projection = get('EPSG:4326'); local_url = 'assets/tile/{z}/{x}/{y}.png'; map = new Map({ target: 'map', ...
0
votes
1answer
45 views

Comparing getValue with map.layers[i].name?

As part of a xtype combo, I would like to know if the layer I choose in my simple data store (represented by this.getValue()) is present in the map layers. So if it does, A should occur, and B if it ...
1
vote
1answer
75 views

Creation of buffer area of 20mtrs upon click event on the base layer

I have a base layer upon which i wish to import a kml with certain lat lons and create a buffer region of 20mtrs around any point upon click event. i got google api for the same but want openlayers ...
1
vote
2answers
891 views

Point icons disappearing in OpenLayers?

I have a very simple setup where I have a feature vector layer on top of an OSM layer in OpenLayers 2.13.1. However, I notice that the icons of my points in the vector layer begin to 'become invisible'...
2
votes
0answers
39 views

Shapefile or GeoJSON? [closed]

I'm interested in understanding the relative merits of using GeoJSON or shapefile formats for handling geo-spatial data, particularly in an open-source, Python (CKAN project), web-development context. ...
0
votes
1answer
124 views

OpenLayers.Filter.Comparison value charecter encoding

I am using vector layer with WFS protocol var adressVector = new OpenLayers.Layer.Vector("Adress", { strategies: [new OpenLayers.Strategy.BBOX()], protocol: new OpenLayers.Protocol.WFS({ ...
2
votes
1answer
4k views

Adding multiple OpenLayers Vector Layer markers to map using AJAX, JSON, and jQuery?

I am attempting to parse a JSON file and place markers on an OpenLayers based map application. I am using jQuery to perform the AJAX and iteration on the JSON file. I am having a problem with the ...
1
vote
0answers
14 views

Zoom to a selected feature with Openlayers 2

var cen = new OpenLayers.LonLat(lng,lat) .transform(proj, map.getProjectionObject()); map.setCenter(cen,30); I need to zoom into the feature selected.
1
vote
1answer
143 views

OpenLayers feature styling change by the baselayer

How can I have the style of the features on a vector layer depending on the OpenLayers' "base layer"? For example, some base layers are dark images and I need (for the contrast) the features to be ...
5
votes
3answers
653 views

Exporting Vector Layer with OGR2Layers Plugin?

I'm using QGIS 2.0 Dufour on my Linux (Ubuntu 12.10).I'm download shapefile of Croatia country from this site (http://www.gadm.org/country) and i added a new vector layer where i created some polygons....
0
votes
1answer
118 views

request two layers in search action of one PanelForm

here's my case: i have a panelForm with 4 fields, and a search button, that search for the features that correspond to the 4 fields given by the user. and i have two layers that both contains the 4 ...
0
votes
2answers
706 views

Redrawing WMS layer on OpenLayers without flickering from GeoServer?

I have a WMSlayer that is updated every 10sec with new data from SQL. Whenever I redraw the layer using redraw(true) , the map screen flickers. Is there a way to do it without flickering ?
0
votes
1answer
22 views

Style OpenLayers.Feature.Vector in OpenLayers.Strategy.Cluster()

I'm using the clastering feature in my project. I collect list of points like so: cluster_features.push(new OpenLayers.Feature.Vector( new OpenLayers.Geometry.Point(lon,lat), {heading:deg} )...
1
vote
1answer
174 views

Automatically refreshing ArcGIS93Rest layer in OpenLayers?

I finally succeeded to import a gtfs-realtime feed into ArcGIS Server (used gtfsrdb.py and the created a script to automatically, every 30 seconds, to update the geometry of a table with the points). ...
2
votes
1answer
6k views

Check if WMS layer is queryable in OpenLayers?

I'm running a map with lots of different WMS layers published by GeoServer. Some of them are queryable, some of them are not. How can I tell that with OpenLayers API? I'm requesting GetFeatureInfo ...
1
vote
1answer
175 views

OpenLayers WMSGetFeatureInfo Windows Mobile

I have built an app using Phonegap build that uses OpenLayers 2.13.1 with WMS layers from GeoServer and I have a WMSGetFeatureInfo control set up. When I click a point on Windows phone 8, the error I ...
0
votes
0answers
34 views

OpenLayers 2.13.1 WMSGetFeatureInfo not working on mobile

I'm using OpenLayers in version 2.13.1. On desktops everything is OK, alert is showing when I click on route. But on mobiles it is not working, probably touch event is not triggered. var infoControl =...
0
votes
0answers
29 views

How to render values onClick() event in componentDidMount()

I am using OpenLayer library and I need change values in ComponentDidMount() but when I am clicking it does not affect. I have used forceUpdate(). handleDisable = () => { this.setState({ ...
1
vote
0answers
104 views

Making layertree with multiple nested nodes? [closed]

On Adding subnodes to layermanager? I asked how to get two levels on a layermanager. The response provided there was what I was needing at that moment. Now, I´ll like to create a little more complex ...
1
vote
0answers
1k views

Adding multiple nested nodes in GeoExt?

I have following codes, but i want to add severel parent>child>chill>child>child (4 level inside) nodes with all check box options (for user choice) in the tree panel, in fact sum of all these (parent ...
1
vote
3answers
514 views

Creating multi-colored raster image based on long,lat,color information?

I want to create a multi-colored raster layer to overlay on my map in OpenLayers I have the following information in my DataBase: D_Cell_ID Long Lat ColorCode 055113 ...
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 ...
0
votes
1answer
56 views

Loading a GPX file using OpenLayers 2

I am trying to read a gpx file and add it as a layer to Open Layers. Here is my code snippet osMap = new OpenLayers.Map({ div: "map", maxExtent: extent, resolutions: ...
0
votes
0answers
265 views

Rotated custom tile set in OpenLayers

I'm thinking of using Openlayers for an interactive map of a building. I'll have custom tile layers for each floor of the building's interior overlaying regular world map tiles. The building is on a ...
3
votes
1answer
982 views

Using selection instead of click for display of features in OpenLayers? [closed]

Currently I am able to display a popup of a feature that was clicked on. I would like to be able to instead of click, to select an area and then show the feature(s) from the selected area. Here is ...
1
vote
2answers
343 views

OpenLayers filter on null and 0

I have this filter: var filter_unset = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.EQUAL_TO, property: attribute, value: 0 }); Now, I want the ...
1
vote
2answers
51 views

zoom set to 4 but on get zoom shows zero ,OpenLayers

var map1 = new OpenLayers.Map('firstmap'); var wms1; var state1="<%=state%>"; var cql_filter1="st_nm='"+state1+ "'"; wms1 = new OpenLayers.Layer.WMS( "OpenLayers WMS", "http://localhost:...
0
votes
0answers
20 views

Conversion from DXF to SVG

I want to convert a file from DXF to SVG and for that I am writing a python script. However, While converting from DXF to SVG there are certain features that are different such as xOffset, yOffset, ...
0
votes
0answers
20 views

Get xy coordinates from latitude and longitude in OpenLayers 2

I'm trying to get the XY on layer but the values are wrong; the lat lon values are correct. I need to convert lat/lon to xy values with OpenLayers 2.
0
votes
0answers
36 views

Set center and zoom after CQL filter

I need to display map on the submenu li click with CQL filter which works for me but map displayed is as shown in screenshot. I am unable to adjust its center and zoom. var map = new OpenLayers.Map('...
2
votes
0answers
486 views

Adding layer as input with code of OpenLayers / GeoExt using GeoServer?

I try to develop a GIS app with raster data. I have integrated the code of the following openlayers example in my app. http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/wps.html I have ...
1
vote
0answers
2k views

Using OpenLayers WFS filter by DATE?

Using openlayers, I would like to create a temporal filter to query a GeoServer WFS service. There is a WFS filter example here without the temporal (date) portion that i need: http://openlayers.org/...
2
votes
4answers
6k views

Disabling map drag and zoom in OpenLayers 3?

I need to disable all map interactions, like map zoom, drag, scroll zoom, any kind of interaction. Is there some easy way to do it?
0
votes
0answers
31 views

How to get the color of pixel openlayes 2?

I'm trying to get the color of the pixel from the map in Openlayers 2. Or is there is a function to get xyz values from rgb?
0
votes
1answer
500 views

Layer leaf nodes replicated across all tree nodes using GeoExt?

This is going on with GeoExt 1.1 and OpenLayers 2.12. I need to build a layer tree dynamically, with layers and nodes that are only known at run time. The snippets I show below correctly create a ...
1
vote
1answer
131 views

Toggle Layers in OpenLayers does not work? [closed]

I am trying to make a map in which I can toggle layers on and off in the navigation bar. A simple version of my code is in the following JSFiddle: http://jsfiddle.net/TimLucas/3cqsmc2L/ If you click ...
0
votes
2answers
143 views

OpenLayers - order of layering from a KML file

I have a set of KML files hosted on a webserver, which two applications use; one uses OpenLayers and one uses Google Maps. The problem is the order they render the KML. Google Maps (and Google Earth) ...
1
vote
1answer
215 views

Truncate coordinates (LonLat) to decimal precision

For example if coordinates are 17.12345678, -82.12345678, and I want to convert them to 3 decimal digits. Expected result: 17.123, -82.123 Is there any API in OpenLayers 2 to truncate coordinates (...
1
vote
2answers
1k views

Execute OpenLayers WPS request using WPS Client

I am having trouble executing WPS processes with the OpenLayers WPS Client. I can execute the processes in Geoserver, however when I try to execute the process from my OpenLayers test app I keep ...
0
votes
1answer
955 views

Serving WMS using MapServer (Mapfile)

I want to display a map from MapServer in Openlayers 2.13. I've prepared the Mapfile: MAP NAME "WMS Server" IMAGETYPE PNG EXTENT 106.637 -6.36199 106.78 -6.231 SIZE 600 300 ...
2
votes
1answer
8k 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 ...
7
votes
4answers
23k views

Get single layer in OpenLayers 3

I am doing an upgrade from OpenLayers 2 to Openlayers 3 and it seems to me that in OL3 there is no direct way to get a layer from map by its id. In OL2 it was like: map.getLayer(id) If we look in ...
2
votes
4answers
1k views

Incremental retrieval of data from a database - OpenLayers

I have a new task now: The user will input the lat-lon values in a HTML form and when an INSERT button is clicked these values should be stored the database. Now when a submit button is clicked the ...
0
votes
1answer
30 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 ...
1
vote
1answer
1k views

Calculating Azimuth between two points in PostGIS?

I have a GIS API based on OpenLayers. I have been trying to implement Azimuth calculation in JavaScript and I needed some way to calculate the Azimuth in order to perform tests. I started using ...