Questions tagged [openlayers-2]

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

Filter by
Sorted by
Tagged with
118 votes
8 answers
97k views

Choosing OpenLayers or Leaflet? [closed]

I was debating with one of my collegues on OpenLayers v/s Leaflet. I made a point that OpenLayers is much better API if we wish to build a project, where you need direct connectivity to the Geoserver ...
Sam007's user avatar
  • 4,395
59 votes
3 answers
27k views

Openlayers Animation Examples and Algorithms

i wonder for a long time if people in this community uses openlayers for animation needs. we have know this that animating on browser is a little bit exhausting for it but when a map meets with ...
45 votes
3 answers
18k views

What is the current Web Mercator projection code?

The web mercator projection, popularised by Google Maps, seems to be given a new EPSG code every couple of years. EPSG:900913 (Google in calculator text) was an unofficial code EPSG:3785 - is the ...
geographika's user avatar
  • 14.3k
33 votes
8 answers
77k views

OpenLayers - redrawing map after container resize

In my web application, I want to enable users to set the size of the map container. Everything worked fine when the container was expanded slightly (apparently this is because the tiles that were ...
Imp's user avatar
  • 878
31 votes
4 answers
41k views

How to define layer order in Openlayers?

I have a marker layer, two vector layers and two raster layers. The marker layer gets covered by the two raster layers. Is there a way to move the marker layer always on top? Edited: The order of Z-...
Seen's user avatar
  • 2,215
30 votes
5 answers
13k views

How to put GeoServer layers behind authentication?

I want to publish map layers using OpenLayers and GeoServer. While this is easy enough to set up, I'm a bit lost when it comes to authentication possibilities. What I want is to create different users ...
Mimo's user avatar
  • 629
24 votes
7 answers
49k views

How do I get the coordinates of a click on vector feature/layer in OpenLayers2?

I need to get the coordinate of the click when the user clicks on a vector feature on the OpenLayers map. The SelectControl only gives the feature that was clicked and not the coordinates of the click....
Vish's user avatar
  • 607
24 votes
4 answers
5k views

Offline tiled map web app

I'm not sure whether to post this here or on Stackoverflow, as it's sort of a crossover. Let me give it a try. In the proposed HTML5 standard, there's the option of storing web application data in a ...
mvexel's user avatar
  • 1,680
22 votes
5 answers
21k views

Map projection in OpenLayers

I want to overlay some data whose projection is WGS-84 on Google map layer in OpenLayers. But I just can't make them in the right place. I did as follows: map = new OpenLayers.Map('map', { ...
ChanDon's user avatar
  • 771
20 votes
5 answers
48k views

Adding simple WFS layer from GeoServer to OpenLayers map

I'm trying to add one of the included datasets with GeoServer to an OpenLayers map. I've followed the OpenGeo tutorials, seen similar thread on here, but I can't seem to crack it. Can you take a ...
geo_james's user avatar
  • 591
19 votes
3 answers
67k 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({ ...
Guillelon's user avatar
  • 313
18 votes
5 answers
22k views

How to Create Animated Cluster Markers in OpenLayers/Leaflet?

I want to use Leaflet due to the smooth transitions which Openlayers seems like they can't match. I specifically require the ability to cluster markers with custom styled marker groups. The best ...
NetConstructor.com's user avatar
17 votes
4 answers
39k views

Get Center of Geometry in OpenLayers 3

Given a Geometry object in OpenLayers 3. How would one go about getting its center? Older versions of OpenLayers provided a getCentroid method. There was also a getBounds workaround. But these appear ...
Joseph Ravenwolfe's user avatar
17 votes
6 answers
28k views

How to use ST_Intersection?

Here's a quick summary about what I'm trying to do: I have 3 tables in Postgres, 'a' and 'b', each have a Polygon column, and 'c' has a Point column. What I'm trying to do here is to get the ...
Uriel's user avatar
  • 373
17 votes
4 answers
1k views

Seeking advice on generic open-source package roadmap? [closed]

I just wanted to ask for advice from the open source GIS gurus on a recommended stack to use for my envisioned project, as I do not fully understand the limits of the possible with most packages. I ...
Jeremy's user avatar
  • 181
16 votes
3 answers
48k views

Remove/Delete a feature from OpenLayers vector layer

I have an OpenLayers layer with several vectors on it. I know the OpenLayers Feature ID (e.g. OpenLayers.Feature.Vector_241) and I would like to know how to remove this feature and only this feature? ...
CatchingMonkey's user avatar
16 votes
1 answer
38k views

Programmatically creating a vector feature in OpenLayers2

I want to create a vector feature, programmatically, on my map. It's supposed to be in the A4-paperformat, for showing a sort of print preview. I've created a control for handling this, but now I'm ...
Kristian Frost's user avatar
16 votes
7 answers
5k views

Comparing two maps with nice web interface?

Is it possible in Leaflet or OpenLayers to compare two maps with a bar to slide between the two? Examples include: http://www.esri.com/services/disaster-response/hurricanes/hurricane-sandy-the-...
Alex Leith's user avatar
  • 13.5k
16 votes
4 answers
18k views

OpenLayers: how to style WFS layer with SLD file?

I'm experimenting with a simple web mapping service build on PostGIS/GeoServer/OpenLayers stack on Win 2008 Server. I overlay vector layer from PostGIS using: var Index1v = new OpenLayers.Layer....
radek's user avatar
  • 10.6k
16 votes
4 answers
3k views

What are some high-profile websites that use OpenLayers and PostGIS?

I think there are many convincing arguments for using PostGIS but I am interested in showing people examples of websites that use PostGIS and OpenLayers. Some examples that I have seen are: ...
15 votes
2 answers
8k views

OpenLayers alternatives supporting more client-side features [closed]

I am considering different architectures for a system that will ideally use client-side rendering for point features and must be plugin-free. I have been using this application developed in response ...
tomfumb's user avatar
  • 3,678
15 votes
2 answers
22k views

Enabling CORS in OpenLayers

Is it possible to enable Cross-Origin Resource Sharing (CORS) in OpenLayers? If so, how? I have a web map in OpenLayers, and I'm using an HTML canvas to render it as a PNG image. My script works ...
Xavier Holt's user avatar
15 votes
4 answers
11k views

Seeking Open Source alternatives to Google's StreetView engine? [closed]

I am looking to create an open source javascript app using either Leaflet or OpenLayers. Is there any way to implement panoramic views (similar to Google's StreetView) into either of these, or any ...
14 votes
9 answers
13k views

The International Date Line wrap around

Using OpenLayers, I added a WFS layer (on GeoServer) with a filter that returns all features (black) that intersect my polygon (yellow) placed over some Latin American countries within certain dates. ...
CaptDragon's user avatar
  • 13.3k
14 votes
2 answers
7k views

Using Geodesic Measurements for Circle Radii?

I am currently developing an OpenLayers mapping site. Measurements can be made using a line tool, and an area tool. Both of these are currently set to calculate geodesic measurements as outlined in ...
geographika's user avatar
  • 14.3k
14 votes
1 answer
6k views

Dealing with overlapping features in OpenLayers

If users create a polygon feature that completely overlaps another one, like this … … then there's no way you can select the inner feature, i.e. the one that's overlapped by the other. I'm currently ...
slhck's user avatar
  • 281
13 votes
10 answers
3k views

What is a good Javascript web API (preferably open) for building web maps that require little/no maintenance?

I have recently volunteered to make a web map for a local non-profit. The map will be pretty basic. It needs to display Lane county, Oregon split into multiple districts, with a "central office" ...
Tanner's user avatar
  • 7,375
13 votes
6 answers
11k views

Free map service for private web applications

Background Looking to display a map (for internal use only) on a web page. The application must be able to add custom layers (without sending the data to the map service host): Municipal zones (...
Dave Jarvis's user avatar
13 votes
2 answers
7k views

Switching baselayers as user zooms in to map in OpenLayers?

I have a map which overlays Open Street Map data on imagery for Pennsylvania. As a baselayer to the roads (and eventually other layers) I have two baselayers - Blue Marble NG and USGS EROS 1ft imagery....
Ian Turton's user avatar
  • 81.5k
13 votes
3 answers
13k views

How to merge two Polygons in OpenLayers?

I have two polygons. polygon1 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing1])) polygon2 = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([linearRing2])) ...
Michelle Chan's user avatar
13 votes
4 answers
21k views

How to overlay lat/lon points on a Google layer in OpenLayers 2?

I'm stuck adding a vector point in lat/lon on top of a Google layer in OpenLayers. The point is moving when I pan the map. This doesn't happen if I replace the Google layer with a layer in WGS84. How ...
underdark's user avatar
  • 84.1k
13 votes
4 answers
10k views

Is it a good idea to migrate to OpenLayers 3 now [closed]

I wonder if OpenLayers 3 is trustable enough to start migrate application to it now. Is the difference between versions 2 and 3 are too much important that the old code wont works? Are the major ...
Below the Radar's user avatar
13 votes
2 answers
12k views

OpenLayers and http basic authentication

I am trying to use OpenLayers 2.12 to display WMS layers from a server which has HTTP Basic Authentication enabled. I have tried to handle the authentication by putting the username and password in ...
iluwatar's user avatar
  • 321
12 votes
3 answers
26k views

How to connect OpenLayers to PostGIS data?

I have read in OpenLayers how to load KML, GeoJSON etc. vector files in OpenLayers. But how can I connect to PostGIS data. If not, why should I upload my data to PostGIS then instead of directly ...
GP92's user avatar
  • 653
12 votes
5 answers
9k views

Tutorial for OpenLayers? [closed]

I need to create a web map showing many raster layers. I am using mapserver and want to use Openlayers, however I can't find any good tutorial about it. I see a couple of old questions (1 and 2) ...
nadya's user avatar
  • 2,481
12 votes
3 answers
3k views

Options for displaying PostGIS rasters in OpenLayers

This question is similar to an earlier question about displaying vector data in a web-map. I want to have a basic web interface which uses OpenLayers and can display raster data that is currently in ...
djq's user avatar
  • 16.3k
12 votes
2 answers
4k views

Technical and usability differences between OpenLayers and Google Maps API V3 [closed]

I know this is supposed to be a wiki question, but the feature has been taken of the site What are the main differences between OpenLayers and Google Maps api? What are the strengths and weaknesses ...
dassouki's user avatar
  • 8,563
12 votes
3 answers
15k views

Using OpenLayers maps with SSL

I am using OpenLayers map by using the hosted JavaScript: <script src="http://openlayers.org/api/2.13.1/OpenLayers.js"></script> But my client has SSL installed and when I try to run ...
Roy M J's user avatar
  • 271
12 votes
3 answers
2k views

Web mapping software for a huge raster time series?

I'm an ArcGIS Desktop user who is stepping into the world of web mapping for the first time. Following advice I found here on GIS.SE, I started with the free tutorials from OpenGeo. However, I ...
dmahr's user avatar
  • 11.8k
12 votes
4 answers
4k views

Simplify GeoServer WFS output

I am dealing with some large datasets and would like to minimise the amount of data sent over the network. I am using OpenLayers' BBox strategy to only transfer the data that is needed but I am ...
Mr_Chimp's user avatar
  • 3,773
12 votes
1 answer
751 views

Understanding OpenLayers documentation

Within the openlayers documentation I’ve noticed that “options” is many times used to show that the constructor takes parameters. But where can I get the details for this parameter {object}? How does ...
CaptDragon's user avatar
  • 13.3k
12 votes
3 answers
4k views

Stack - Mapnik, TileMill, OpenLayers, GeoExt

Would this work as a stack for serving web maps with the basic GIS viewer functionality (pan, zoom, layer switching, info popups)? Apache Web Server Mapnik to serve the geo-data (TileMill to Style ...
user avatar
12 votes
4 answers
6k views

Is it possible to put Geoserver behind a proxy and access the WMS/WFS using OpenLayers

I just start to work with Geoserver and Openlayers and one of the main concerns of the project now is do not expose the geoserver web interface outside of the internal network. No access to www....
machado's user avatar
  • 123
11 votes
3 answers
3k 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'...
kschaos's user avatar
  • 113
11 votes
2 answers
21k views

Google Maps not Showing in QGIS 2.12

The Google Maps in my OpenLayers plugin in QGIS 2.12 does not show anymore. The other maps do show, that is: OSM Bing MapQuest Stamen Apple Maps I tried in QGIS 2.8 and Google Maps does not show ...
Jim's user avatar
  • 343
11 votes
2 answers
3k views

Is there a way to draw a straight line on a map which also represents a straight line on the earth surface?

I'm trying to understand more on projections. In this example, why must one calculate the curvature of the earth (great circle) if the map is already projected? Is there a way to draw a visibly ...
CaptDragon's user avatar
  • 13.3k
11 votes
3 answers
4k views

Rendering images in OpenLayers?

My organization has a web application for displaying global and regional climate data and we're considering improvements to it. Our leading idea is to create an OpenLayers-based application to ...
Hiebert's user avatar
  • 119
11 votes
3 answers
28k views

How to change color of a feature in openlayers?

I'm loading a geojson file into openlayers to show some polygons. From this file I also create a list of all names of these polygons. Now I want to change the color of a polygon when selected from ...
jlai's user avatar
  • 211
11 votes
3 answers
7k views

GeoServer OpenLayers preview always points to localhost:8080

In GeoServer, when I go to Layer Preview/OpenLayers, I get a web page, but the HTML points to localhost:8080 (instead of a relative path) for its WMS requests, so I can only see previews on the server ...
Wouter van Nifterick's user avatar
11 votes
3 answers
10k views

In OpenLayers zoom to extent of all overlays

In Openlayers I can zoom to the bounding box of all layers like this: map.zoomToExtent(); I can also zoom to the bounding box of a single layer: map.zoomToExtent(layer_name.getDataExtent()); Is ...
Mr_Chimp's user avatar
  • 3,773

1
2 3 4 5
66