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

learn more… | top users | synonyms

0
votes
2answers
3k views

Create different CSS for Two Buttons in One Control Panel

I am having a problem applying CSS to two custom OpenLayers buttons. I create a PANEL toolbar and then add 8 buttons to it. The ZoomBox, DragPan, ZoomOut, ZoomIn, and nav.next and nav.previous buttons ...
1
vote
0answers
208 views

Problem HTTP request for KML

i have a problem with HTTP request for KML to add to map. This is my HTTP request: var x = new OpenLayers.Layer.Vector("X", { projection: new OpenLayers.Projection("EPSG:4326"), strategies: ...
2
votes
2answers
1k views

OpenLayers - Test Control To See If It Is Active

I am trying to get the active state of an OpenLayers SelectFeature control. I create this control and add it to my map but I do NOT activate it yet. This part works fine. Here is the script to create ...
3
votes
2answers
1k views

OpenLayers spatial filter polygon problem

I've got a dataset of English Counties (currently cut down for testing) that I'm serving from SQL 2008 using MapServer and OpenLayers. The features in my dataset are appearing in the right location on ...
2
votes
0answers
376 views

What are the differences between Anchored, Framed and FramedCloud?

From the API document for OpenLayers, I can tell that a FramedCloud has more functionalities than Framed, which in turn has more functionalities than Anchored. I am hoping for someone to describe ...
2
votes
0answers
408 views

OpenLayers BBOX sending double requests

I've implemented a openlayers bbox strategy on a vector layer. I have my server return a nice jsonp object wrapped in the callback given by the request. The problem is that during normal use of the ...
3
votes
1answer
176 views

Does OpenLayers have the ability to mask a raster with another layer?

Does OpenLayers have the ability to mask (in the GIS sense) one raster layer by another vector (or raster) layer? For instance this would be the ability to show only the parts of one layer that are ...
0
votes
1answer
1k views

delete feature from database by selecting feature from vector layer [closed]

I want to delete a feature attribute for example say grid completely from the map that is it has to be deleted from database. I am using OpenLayers 2.12, postgis 2.0 and postgresql 9.0. Please guide ...
4
votes
1answer
2k views

Overlaying WMS from Mapserver in OpenLayers with epsg:900913 from Google/Bing/OpenStreetMap

ADDED: Another curious effect is that no matter to what scale I zoom on the baselayer google/bing map, the WMS overlay is always the same-sized shot of MN. That is, as the baselayer map is scaled up ...
2
votes
1answer
1k views

applying SLD to WMS raster in OpenLayers

I am attempting to adjust the symbology of a loaded WMS raster layer (img file through MapServer). It is the NLCD dataset. The WMS layer loads find with nlcd = new OpenLayers.Layer.WMS( 'nlcd', ...
1
vote
1answer
109 views

Double output with getfeaureinfo request with Mapserver and Openlayers

I am trying to make an popup InfoTool in OpenLayers with a Mapserver file. Everything is working fine now. But when I click on the map I gives a double output. So I get for instance: cityname, ...
1
vote
2answers
739 views

How to Add image and hyperlink along with GetFeatureInfo Popup?

I want to cutomize the Geoserver GetFeatureInfo Popup. I want to add image against each parcel I click. For this purpose I've read to change the content.ftl file of geoserver. But I found that file ...
4
votes
0answers
157 views

GeoServer pregeneralized layers not working as expected

I've set up GeoServer 2.1.4 and installed the feature-pregeneralized-2.1.4.jar plug in and processed my shape files into each of their separate folders with the generalized shapefiles and I've check ...
5
votes
2answers
2k views

How to create a simple drop down box in openlayers?

I am trying to place a simple drop down box above the open street maps. Can some one guide me how to achieve this... I know we need to make use of open layers.... i tried to create a button with below ...
3
votes
1answer
388 views

Limit Zooming Geometry Features in OpenLayers

I draw flag feature on my map as follows: myVectorLayer = new OpenLayers.Layer.Vector("Flag Geometry", { renderers: renderer, isBaseLayer: true, projection: new OpenLayers.Projection("EPSG:900913"), ...
2
votes
2answers
1k views

Howto change OpenLayers BBOX request projection?

My map uses EPSG:900913 projection on the map. All coördinates in the database are stored in the 'normal' google format / GPS coordinates (WGS84). For instance, if you save a new location..Before I ...
3
votes
1answer
830 views

adding polygon to database in openlayers

I want to add a polygon to the database. I used the following code. The problem is that I am to able to save in database. Whatever polygon I draw on map it gets save temporary and as soon as I reload ...
2
votes
1answer
883 views

LoadingPanel - Waiting for Vector & WFS loading

I have vector layer with WFS protocol. and because I have a huge amount of data, there is a while before features loaded on the map. So i need to tell user to wait a moment until they load by ...
10
votes
1answer
237 views

Stratified OpenLayers Clustering

I have an OpenLayers map with point clustering, but I want to apply a much finer granularity to the data represented in the map. Specifically, I want to stratify the clusters according to an ...
6
votes
2answers
2k views

How can several vector layers have different controls, using Openlayers?

Using openlayers I have two vector layers. One layer is called lineLayer consisting of vector lines, and the other is called pointLayer consisting of points. When I hover on the lines I want to be ...
9
votes
2answers
465 views

Best design for Open Source Python / PostGIS prototype

I am writing a data intensive web application that is delivered through apache. My question is about how to best arrange processing given that there are multiple options. I have at my disposal ...
1
vote
1answer
746 views

Openlayers - Vector Layer - Combining hide/show features using style property

I am trying to filter vector layer features according to their attributes. I have 4 check boxes: type_1, type_2, shape_1 and shape_2 Note that I am using Extjs for interface. at beginning I could ...
5
votes
1answer
973 views

OpenLayers and Google Maps when panning tiles not in sync [duplicate]

I want to overlay WMS tiles on Google maps using the following scales 1:287 / 1:573 / 1:1146 / 1:2292 (layer preview in geoserver) I set a bounding box and a centroid for a specific area to set ...
2
votes
2answers
2k views

How to update a Vector layer with WFS protocol, after updating the filter?

I am using a Vector Layer with WFS protocol to show only a subset of the data. The filter which defines the subset, changes dynamically from the code. How do I refresh the layer, to show only the data ...
1
vote
1answer
262 views

How can I change the CSS style of the geoserver rendered map produced when I click on “Open Layer ”Tab under “Common format”?

I have tried many times with left no stone unturned, but all efforts came in vain. I might be of less knowledge in this area. Then through surfing I found this site as a newbie. I will be very ...
3
votes
1answer
891 views

OpenLayers code didn't response popup featureinfo

Hey I'm trying to popup the featureinfo of WMS layer using OpenLayers code. But it does'nt work. Instead the cursor moves in the state of continous moving when I click on map. Here is my code: ...
1
vote
2answers
545 views

Make Openlayers request WMS tiles only within a certain bounds

Is there a way to actually tell openLayers not to request tiles out of particular bounds? I want the rest of map and other layers still accessible, so maxExtent on map is not an option for me. I ...
2
votes
1answer
60 views

What is the purpose of having a separate Layer property for sphericalMercator?

The Beginner's Guide to OpenLayers 2.10 says the following: sphericalMercator {Boolean} This property determines if the map should behave as a Mercator-projected map. Setting this to true ...
1
vote
2answers
548 views

How to edit using a WFS service, without showing it on the map in OpenLayers?

I have a service with about thousand points. I wish to enable the user to edit the attributes of the features. Since there are so many points, I don't want to display them as a vector layer (using ...
3
votes
1answer
270 views

Why are two incompatible projections used together in OpenLayers? [duplicate]

While going through the examples in OpenLayers, I notice several examples with the following code: map = new OpenLayers.Map('map_element',{ ... units: 'm', projection: new ...
1
vote
1answer
704 views

OpenLayers / Mapserver WFS Filter: <gml:null>missing</gml:null>

I'm trying to filter features in OpenLayers when moving a JQueryUI slider. It works like this: EDIT: full files available here on GitHub. JQueryUI slider When moving the slider cursor, minSelection ...
1
vote
1answer
90 views

How do I get the coordinates of a click on vector feature/layer in OpenLayers transformed to another projection system?

I need to get the coordinates of the click when the user clicks on any place on the base map. I have checked the answer to similar problem here: How do I get the coordinates of a click on vector ...
2
votes
2answers
2k views

how to display map center coordinate using openlayers

As far as I know that openlayers can display our mouse coordinate position. However, I do not know how to display map center coordinate? Can anyone help me? thanks for your helping guys!
0
votes
1answer
405 views

What would be the URL of a JSON file on the local drive?

When i save json file in web apps then using http://localhost:8080/WGSClient/js/object.json this path file gets open.But when i keep it outside web apps like local folder then using same url format ...
3
votes
2answers
2k views

How to 'highlight' a selected country?

All, Over the past several days I've read as much as possible regarding the OpenLayers API (within a JavaScript/jQuery environment), yet I'm still having trouble in getting my head around what I ...
3
votes
1answer
216 views

msWFSGetFeature(): WFS server error. FLTApplyFilterToLayer() failed

I have the following code that generates a map with a couple of layers. var PIDS = ...
1
vote
1answer
162 views

BBOX strategy to load all features?

Since I have no way, other than using BBOX strategy with my vector layer + wfs protocol Is it required to use BBOX strategy with WFS protocol in OpenLayers? I'm wondering if there is a way to force ...
2
votes
1answer
1k views

Openlayers with allOverlays = true. How to create a dummy (base) layer?

I have an OpenLayers map with allOverlays set to true. Im adding 3 layers to the map. First, my own rendered version of OSM data (but only for levels 8-16), secondly an orthophoto layer (for levels ...
3
votes
2answers
2k views

How to make the Overlays section in an OpenLayers LayerSwitcher exclusive?

At the simplest level I need to figure out how to create a customized OpenLayers LayerSwitcher Overlays section which is not using Checkboxes, but uses RadioButtons instead. For my application its ...
2
votes
1answer
193 views

OpenLayers.Layer.clone() not returning a unique Layer object

I'm taking a layer (layer_orig) and calling the clone method to create a new layer (layer_clone) with same features, styles, etc. I am changing the name and map instance of the layer with: ...
2
votes
1answer
2k views

How to use OpenLayers cluster strategies without using a Protocol

Using OpenLayers with Bing maps, I'm trying to load JSON data from a service URL and assign an array of clustering strategies to the resulting layer. There are plenty of examples of using cluster ...
0
votes
1answer
745 views

Showing custom markers, shadows and popups from json data

The examples given in the documentation of Open Layers show very basic ways of utilising the different features. This example shows how to add shadows to the marker. This example shows how to create ...
1
vote
1answer
3k views

How to use getfeatureinfo with MapServer and OpenLayers?

I'm trying to use the getfeatureinfo function of Openlayers with MapServer. When I click on a point on my map, I get the following error in Firebug: <?xml version='1.0' encoding="ISO-8859-1" ...
0
votes
1answer
481 views

Openlayers loop through json array and output result with as javascript

Connection.php file which stored database connection code with json: <?php $username = "root"; $password = ""; $database = "roadmap"; $url = "localhost"; $con = mysql_connect($url, $username , ...
6
votes
1answer
905 views

What is the difference between projection and displayprojection for a Map in OpenLayers?

I am familiarizing myself with Openlayers, and am having trouble with understanding the projection and displayprojection properties for a Map. When the map is initialized with the following code: ...
1
vote
1answer
120 views

Why does an OpenLayers map.getNumLayers() return 0 even though I've added a layer?

When I try the following code, OpenLayers returns a zero result. What have I done wrong, here? var map; function loadMap () { // Based on example code: view-source: // ...
2
votes
1answer
83 views

How to put image over the layer in OpenLayers

How to set the Latitude and Longitude range that focuses on a specific region in Mercator Projection when the layer loads in OpenLayers API ? Is there any way to put image over the layer?
1
vote
2answers
874 views

Is it required to use BBOX strategy with WFS protocol in OpenLayers?

is it a must to use BBOX strategy with WFS protocol in Vector layers ? I cannot display this layer without BBOX strategy: vLayer = new OpenLayers.Layer.Vector("Test", { styleMap: new ...
3
votes
1answer
761 views

Can't get MapServer WFS to display in OpenLayers

I'm new to OpenLayers and MapServer and I'm trying to serve a shapefile through a WFS but can't seem to get the data to display. When I use Firebug and HttpFox in Firefox I seem to be getting some ...
1
vote
1answer
301 views

How to get map to parse input bounds as degrees?

I just started to learn Open Map and I am having some difficulty working with the API. This may look trivial, but please bear with me. I am trying to get Open Map to display a region of the map ...