OpenLayers is a JavaScript library for creating dynamic map widgets for web sites.

learn more… | top users | synonyms

7
votes
2answers
4k views

displaying feature info in a popup

Thanks to Nicklas' anwer to my previous question... I was able to "combine my shapefile and CSV data have made a lot of progress on my project. Now I want to display the attribute data in a popup ...
6
votes
3answers
619 views

Advantages of WFS over GeoJSON/KML?

I'm planning to create an online map with openlayers (2 or 3) or leaflet. I have to show some points/markers (~30.000), polygons (~500) and lines on top of an OSM map in several layers. Those points ...
6
votes
1answer
1k views

Add a OpenStreetMaps road data layer on Google Maps API v3

I've successfully embedded a Google Maps API v3 map on my site, and added OpenStreetMaps (OSM) as the base layer. Is it possible to use Google's tiles as the base layer, and then overlay street data ...
6
votes
3answers
3k views

Difficulty to display WMS and Googlemaps layers using Geoext and ext

i have the following code on my html file: // World Geodetic System 1984 projection var WGS84 = new OpenLayers.Projection("EPSG:4326"); // WGS84 Google Mercator projection var ...
5
votes
4answers
9k views

Customizing Popups in Openlayers

Is it possible to customize the shape of popups in OpenLayers? For example, I am creating a pop-up using the following approach: var popup = new OpenLayers.Popup.FramedCloud( "popup", ...
5
votes
1answer
1k views

MGRS in OpenLayers

I am trying to view the Military Grid Reference System coordinates in Openlayers through the MousePosition control. Is there an easy way to accomplish this just through Javascript? I am looking at the ...
5
votes
3answers
3k views

Different level of detail(layers) on different zoom level at OpenLayers map

I want display different detail(layers) on different zoom level on OpenLayers map. I mean when zoom in should display lot of layers and when zoom out those unsuitable layers should hide automatically. ...
5
votes
2answers
4k views

How to change the WMS Background Color in OpenLayers?

I am using geoserver to serve up an image pyramid basemap. I want to have all areas outside of the data extent be black (instead of white). I have the map displayed inside of a div tag and changing ...
5
votes
1answer
3k views

Is it possible to display the length of each segment with the Openlayers measure control?

I am trying to make a OpenLayers measure tool that displays the length of each segment on top of each segment and the total length of the measurement as shown below: I have used this example ...
4
votes
1answer
263 views

How to create a vector feature drop target?

I would like to create, inside an openLayers map, a drop target for my features. The user should be able to drag a vector feature, drop on the target so that some further action can be triggered (in ...
4
votes
1answer
1k views

How to integrate OpenLayers and ArcGIS Server?

I am using the OpenLayers JavaScript API within a web application. I am displaying non-base layers hosted on an ArcGIS server. When I load the ArcGIS layers, I load them using ...
4
votes
3answers
543 views

WFS Caching / Back button

I'm using WFS protocol on Vector layer / GeoServer / PostGIS Currently the map is refreshing and calling new requests whenever i do anything like searching or drawing and when i move back to a part ...
4
votes
1answer
1k views

WFS-T: changes not saved on an OpenLayers map

I have written a script allowing to display a few WMS and WFS layers and I want to make my 2 WFS layers editable. I have all my controls and can draw / modify / drag / delete my features but, on one ...
4
votes
1answer
4k views

Saving Google Earth Location: OpenLayers Plugin in Quantum GIS

I use the OpenLayers plugin to load Google Earth Layers in Quantum GIS to digitize/identify certain features. As my work is large occassionally I have to quit Quantum GIS to resume later. The problem ...
3
votes
3answers
970 views

GeoServer layer preview shows only missing images for tiles

Just getting started with GeoServer and already running into problems. When I click on Layer Preview and view any of the preloaded data in OpenLayers (or any other format) it is just blank and has the ...
3
votes
1answer
1k views

Problems with gxp Print plugin via opengeosuite sdk

I am trying to import the print plugin within an application built using the Opengeo Suite sdk and I have run into issues as is described in the following thread ...
3
votes
1answer
2k views

How can GeoJson polygons be colored programmatically using OpenLayers?

I'm experimenting with dynamically setting the color values of a geojson polygon. In my geojson file, there is an attribute for each polygon called pop_den. I am trying to update the fillcolor of the ...
3
votes
1answer
2k views

Cant see WFS-T layer with OpenLayers and GeoServer (Windows)

I am trying to implement a simple test of a OpenLayers + WFS-T + GeoServer -setup. I have followed the instructions by populating PostGIS and configuring GeoServer, and can see the WFS-T layer data in ...
3
votes
0answers
2k views

How to edit Attributes on WFS Layer through Popup?

I am working on a project for university. So far I have displayed WfsLayers which can be select from a panel, also I can click on my points whereupon a Popup will show up with some information which ...
3
votes
1answer
1k views

How to send WPS request using OpenLayers

I have generated the WPS request below using GeoServer's WPS Request Builder. I wish to append more parameters to this request (geometry selection), and then send it either using GET or POST from ...
3
votes
2answers
1k views

How to change the vertex style for editing?

When I use drag feature, then the circles on the polygon edge has the same style. For example, this OpenLayers site. I need to change it, I mean they need to be a different color. What is their ...
3
votes
1answer
2k views

XYZ Layer in Open Layers has Missing Tiles

In Open Layers I'm having a missing tile problem where it generates a missing link icon and a pink background. I found several threads including this one saying to add this code ...
3
votes
2answers
2k views

Openlayers create, edit and save/export to kml

I'm trying to create, edit and save a point vector as kml file in an Openlayers app. I have managed the create and edit by adding and empty vector layer and then adding the control ...
3
votes
1answer
4k views

How to draw lines with different colors in Openlayers?

I want to display multiple polylines with different colors in openlayers. Can any one guide me regarding this. I have done this in google maps. but i don't know how to do it in openlayers. I am ...
3
votes
3answers
2k views

How to register onclick handler for *all* KML feaures in OpenLayers?

I'm a newbie using OpenLayers with JQuery to display vector data from KML files. I'm creating the layer like this: newlayer = new OpenLayers.Layer.Vector( layerid, { projection: ...
3
votes
1answer
3k views

Reproject a vector layer (EPSG:27700) using WFS onto a googlemaps background (EPSG:900913)

I have the following HTML-javascript code and i have problems reprojecting the vector layer (WFS) from EPSG:27700 (British National Grid) to EPSG:900913 (googlemaps). I managed to project the WMS ...
2
votes
2answers
729 views

GeoServer and OpenLayers in production - Securing WMS calls?

I've a mapping site where users have to login in with username and password. Once logged in the user gets a map of their data using WMS and WFS to display and edit data. This data is served using ...
2
votes
2answers
589 views

How to get a feature that lies closest to a point in openlayers?

Im trying to perform routing with openlayers, geoserver and mysql. In order to get the start and end points, I need to be able to get a feature of the node layer (which has point features) that lies ...
2
votes
2answers
501 views

Create CMS system using Cartaro

The main objective for our project is to create a portal website in Drupal. On this website, people must be able to upload their geographical datasets (mostly shape files, but also xml files that ...
2
votes
3answers
737 views

how to change color of feature to mark it as recently modified with openlayers

I am developing a crowd sourced app using openlayers. after user clicks an feature, a popup form is displayed. After clicking the save button, the data is used in processing which takes some time so ...
2
votes
1answer
1k views

Openlayers - Get extent of WFS vector layer and zoom to that extent when map

I would like to do the following: 1) While loading an OpenLayers map object get the lat/long Bounding Box of a WFS vector layer served from GeoServer. 2) Use the extent from the WFS vector layer to ...
2
votes
4answers
1k views

creating 2 dragable layers at the same time in OpenLayers?

I have been been working with this for a while now. Whenever you add 2 seperate draggable layers, openlayers will only activate the last one added. I wish it could be as simple as the code below. But ...
2
votes
1answer
2k views

Creating Vector features onload in Openlayers

Using openlayers and javascript I wish to create two vector layers and add a polygon to one of them and a circle with a centre point to the other My polygon will be in WKT and my circle will be a ...
2
votes
1answer
936 views

How to unproject coordinates on a Google map with Openlayers?

Below is my code and a pic. When I finish making my circle on a Google map with Openlayers, I get the following coordinates but I want coordinates like E.G: bottom: -27.762124575762 left: ...
2
votes
1answer
845 views

geoserver wfs insert error

I keep getting an insert error from geoserver when trying to save a point, poly etc etc to my postgis table. any ideas, my code is below var Projection = new OpenLayers.Projection("EPSG:4326"); ...
2
votes
4answers
662 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 DB. Now when a submit button is clicked the markers ...
1
vote
1answer
63 views

how to limit zoom level in OpenLayers

I would like to have only 3 levels of zoom available (from level 6 to level 8). demolayer2 = new OpenLayers.Layer.WMS( "abc...","http://localhost:8080/geoserver/gwc/service/wms", {layers: 'def...', ...
1
vote
1answer
88 views

Problem with using a circle as polygon for querying PostGIS

I'm trying to query PostGIS and find some object features that intersect with a circular buffer created by the user using OpenLayers, JavaScript and PHP. I use the following code for creating the ...
1
vote
1answer
749 views

Probleme with WFS protocol in OpenLayers

Sorry for disturbing. I know my problem look common, but I really don't know what to make. Here is my code for getting a WMS layer in OpenLayers from Geoserver. var wfs2 = new ...
1
vote
2answers
829 views

How to use Google Maps geocoding with Openlayers?

I'm making a Openlayers map with some shapefile and I have Google Maps base layer. I want to create a text area and a button. When I input a address and click the button, the map should show me the ...
1
vote
1answer
2k views

Integrate GeoJSON file with openlayers.protocol.http

I've got a problem with (the title says it) integrating a geojson file in my openlayers map. I have to use the openlayers.protocol.http way. I examined lots of examples on the web (and on ...
1
vote
1answer
2k views

How can I add an infowindow to an OpenLayers GeoJSON layer?

In my OpenLayers script I refer to an geojson layer. Is it possible to add an info window?If yes, how can I create this. Script is as follows: var lon = 5, lat = 52, zoom = 7, epsg4326 = ...
1
vote
1answer
814 views

GetFeature Request with Polygon Intersecting Polygons

My task is very straightforward: a user draws a polygon and query all parcel polygons. The query string extends the URL limit. So I am posting XML to WFS. However, GeoServer always returned 0 feature, ...
1
vote
1answer
765 views

Googlemaps Layer on Openscales

I'm using openscales in a web mapping project, i would like to add a Google maps layer, i know that there's some licence problems , but i don't care for these licence issues, i'm looking to add ...
0
votes
1answer
492 views

How get Map extents for draw polygon when final click is done?

I am using openLayer js to draw a polygon and now i want map extents of the drawn polygon one final click (i.e. user finish drawing polygon or double click is done). For drawing the polygon i am using ...
0
votes
2answers
10k views

Openlayers How would i get a hover label over my polygon

make a hover/mouseover label for a polygon in Openlayers? I made a map with draw, delete and drag polygon function. Now I need to make a hover mouseover for this. How to get a hover label for ...
0
votes
3answers
5k views

Understanding the polygon handler function in Openlayers

Using openlayers, I want to be able to draw one polygon on a map. After one polygon is drawn, I want an event to fire that stops any more from being drawn until a button is pressed. My current code ...
0
votes
1answer
3k views

Query Feature using OpenLayers + MapServer

I'm trying to query a feature in OpenLayers, but it's returning just an image highlighted that is not possible to make zoom, pan and drag. My intention is to query a feature on the map like street ...
9
votes
2answers
6k 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 ...
8
votes
1answer
3k views

getExtent() in OpenLayers returns strange values

I'm trying to get the bounding box of the map area displayed by OpenLayers. I tried to use map.getExtent() because it should be exactly what I need, but the returned values are "strange": For ...