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
0
votes
0answers
18 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({ ...
0
votes
1answer
21 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', ...
1
vote
0answers
103 views

Making layertree with multiple nested nodes? [on hold]

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 ...
0
votes
1answer
29 views

How to convert XYZ Source for OpenLayers from tile/z/x/y to something else? [on hold]

I am using openLayers to create a map and for the source I am using XYZSource which takes file in the given format: z/x/y.png but i want to know if there is any other ways to assign the tiles instead ...
1
vote
3answers
510 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
49 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
261 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
965 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
340 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
50 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
16 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
18 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
30 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
482 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
29 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
130 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
1answer
21 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} )...
0
votes
2answers
132 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
205 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
945 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
22k 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
974 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 ...
0
votes
1answer
391 views

Multiple Layers+Retrieval of data from DB? [closed]

I have some big & complicated task this time. I have 2 html pages(page1 & page2). Page1 is for viewing tha map. And page2 is for inputing the values(lat-lon) in a form. Any user can input ...
2
votes
3answers
45 views

Using Proj4js with OpenLayers to transform lat lng from 4326 to 27700 but coming out unchanged

Using Proj4js to transform lat lng from 4326 to 27700 but coming out unchanged. I am using OpenLayers 2.12 (OS API Leisure map) EPSG 27700, Proj4js (CDN) I have added the definition to proj4 ...
1
vote
3answers
4k views

How can I use measure tool with Openlayers 3?

I didn't see any mention for measure tool in OL 3 API. Is there an alternative / a way to use a measure tool (line & area) with OL 3 ?
13
votes
3answers
42k views

Change OpenLayers 3 view center

I'm using OpenLayers 3 to interact with some maps. I first declare my map: map = new ol.Map({ target: 'map', layers: [ new ol.layer.Tile({ ...
2
votes
1answer
999 views

GetLegendGraphic request string is too long?

I am setting the SLD Body of a WMS layer on the client side. I set the style in JSON and I have some functions that convert the JSON to SLD (OpenLayers functions). It works fine for displaying the ...
0
votes
0answers
22 views

Show coordinate in OpenLayers 2?

I want to show coordinate of every point in OSM. I am using OpenLayers 2. The below code is not working and does not show any error in the console. What is wrong with that code? var popup = Ext....
2
votes
2answers
3k views

ArcGIS93Rest for Openlayers 3

In Openlayers v2 I could get a map from an ESRI server that was not a cached service using code similar to below var arcims = new OpenLayers.Layer.ArcGIS93Rest("MyName", "http://sampleserver1....
1
vote
0answers
1k views

Putting highcharts chart in OpenLayers popup?

I build a openlayers map on my website. and there are many feature vector on the map. now I want to put a highcharts charts in popup. to show the temperature in every city something Like this If ...
0
votes
1answer
81 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 ...
0
votes
1answer
187 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
34 views

setStyle() throws assertion error 41. https://openlayers.org/en/latest/doc/errors

I am trying to set the style of open layer by passing in an object but it is throwing error and when object is passed in an array then it works. Why isn't it letting me pass an object? The code below ...
3
votes
2answers
1k views

OpenLayers forEachFeatureAtPixel finds point when clicking in the lower part or below the symbol

I have OpenLayers 3.0 map with vector layer (geojson data) and try to add tooltip, when the point on map is clicked. I use the forEachFeatureAtPixel (edit: was allFeaturesAtPixel) function for finding ...
0
votes
1answer
125 views

OpenRailwayMap not functioning with OpenLayers 2

I am trying for several days now to integrate a basic OpenRailwayMap into a project using OpenLayers 2 API but it's simply not working. I followed all the steps mentioned here and ended up with ...
5
votes
3answers
4k views

Dealing with thousands of features of vector layer in OpenLayers?

I am building a webgis portal too show a big number of polylines (road network) and points (villages, cities etc.). All my data are stored in a POSTGIS and throuh geoserver and Openlayers I display ...
3
votes
2answers
455 views

geojson data not getting displayed on map (Openlayers) in Geodjango

I have the following code. models.py class PFT(models.Model): species=models.CharField(max_length=50) geom = models.PointField(srid=4326) objects=models.GeoManager() def __str__(...
0
votes
1answer
72 views

Is there a way to limit google street view to extent on openlayers 2?

I would like to be able to limit the Google street view area in my map to to 500m radius from where the panoramic street view starts ( this is where the user clicked the mouse on the map) Is this ...
0
votes
1answer
218 views

Making photo gallery for OpenLayers?

me and my collegue are making a web map application for my town for tourism purpose. The map itself is pretty done, actually, so we were wondering whether add some photos of the town, or that shows ...
0
votes
1answer
75 views

OpenLayers ArcGIS93Rest symbol size

I'm using OpenLayers 2 to display ESRI WMS data (ArcGIS93Rest layers). The data I'm displaying contains symbols (and sometimes labels) and I'd like to increase the display size of these symbols (...
1
vote
1answer
331 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 ...