Compare commits

...

8 Commits

Author SHA1 Message Date
crschmidt
7922c48608 Tag OpenLayers 2.5 Final Release.
git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.5@4899 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-10-09 17:45:37 +00:00
crschmidt
e65caac909 Pullup r4819 from trunk: fixing GeoJSON serializer breakage caused by draft4
update. (Closes #1062)


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4830 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-10-04 22:51:23 +00:00
crschmidt
4f62fdcfc8 Pullup for KML needs to automatically determine the namespace of the document
it is handling. (Closes #1044)


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4798 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-10-03 21:18:39 +00:00
crschmidt
c505d23c7b Pullup fix for zooms to branch. (Closes #1043) 4791:4792
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4795 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-10-03 20:42:35 +00:00
crschmidt
6ecd34eaf0 Pull up most of the changes for what will be 2.5RC4:
* Clone on WMS/MS Untiled, 4760:4761 (Closes #1013) 
 * serviceVersion on TMS, 4720:4721 (Closes #1023)
 * W3CGeo in Format.GeoRSS, 4768:4769, 4778:4779 (Closes #1024)
 * GeoJSON Draft4 Update, 4769:4770 (Closes #1028)
 * pagePosition Regression 4782:4783, (Closes #1034)
 * example changes 4691:4692 (Closes #1040)
 * WFS missing registerTileListener 4759:4760 (Closes #1045)
 * Yahoo API to stop dragging 4792:4793 (Closes #1052)


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4794 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-10-03 20:27:15 +00:00
crschmidt
ef306a7cbe Pullup changes for RC3:
* KML Examples broken (Closes #1001)
 * drag handler doesn't reset properties on left or improperly modified mousedown (Closes #1003)
 * Text nodes limited to 4096 in length (Closes #1006)
 * KML/GML Attribute CDATA Parsing (Closes #1007)
 * Control.MousePosition (Closes #1008)


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4432 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-09-21 13:32:42 +00:00
crschmidt
995ef95dba Pullup changes to trunk for RC2. Includes drag-fires click changes
(Closes #982), comment/documentation/requires changes (Closes #983, #993, #988),
Fixing post support in proxy.cgi (Closes #991), baseLayer zoom level change 
(Closes #990), typo in Layer.Image.setURL (Closes #985), and a fix or the
Layer.Google bug caused by Google's changing internals (#994). RC2, here we 
come.


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4390 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-09-19 11:36:13 +00:00
crschmidt
f5eb0517ef Branch for 2.5.
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.5@4346 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2007-09-17 03:52:00 +00:00
132 changed files with 964 additions and 577 deletions

View File

@@ -2,8 +2,8 @@
OpenLayers.js -- OpenLayers Map Viewer Library
Copyright 2005-2007 MetaCarta, Inc., released under a modified BSD license.
Please see http://svn.openlayers.org/trunk/openlayers/repository-license.txt
Copyright 2005-2007 MetaCarta, Inc., released under the BSD license.
Please see http://svn.openlayers.org/trunk/openlayers/release-license.txt
for the full text of the license.
Includes compressed code under the following licenses:

View File

@@ -1,30 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
#map {
width: 800px;
height: 475px;
border: 1px solid black;
}
</style>
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var lon = 5;
var lat = 40;
var zoom = 5;
var map, layer;
function init(){
map = new OpenLayers.Map('map');
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.addLayer(new OpenLayers.Layer.GML("KML", "kml/lines.kml", {format: OpenLayers.Format.KML}));
map.zoomToExtent(new OpenLayers.Bounds(-112.292744,36.068477,-112.22408,36.109246));
}
</script>
</head>
<body onload="init()">
<div id="map"></div>
</body>
</html>

View File

@@ -19,8 +19,8 @@
layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
"http://labs.metacarta.com/wms/vmap0", {layers: 'basic'} );
map.addLayer(layer);
map.addLayer(new OpenLayers.Layer.GML("KML", "kml/mc-search.kml", {format: OpenLayers.Format.KML}));
map.zoomToMaxExtent();
map.addLayer(new OpenLayers.Layer.GML("KML", "kml/lines.kml", {format: OpenLayers.Format.KML}));
map.zoomToExtent(new OpenLayers.Bounds(-112.306698,36.017792,-112.03204,36.18087));
}
</script>
</head>

View File

@@ -6,22 +6,31 @@ restrictions that prevent the Javascript from loading pages not on the
same server as the Javascript. This has several problems: it's less
efficient, it might break some sites, and it's a security risk because
people can use this proxy to browse the web and possibly do bad stuff
with it. If you can get your code signed (see:
http://trac.openlayers.org/wiki/HowToSignJavascript), then you should
modify Parameters.js so that this isn't used. Otherwise, you're stuck
with it. It only loads pages via http and https, but it can load any
content type. XML and HTML are both currently used by Openlayers."""
content type. It supports GET and POST requests."""
import urllib
import urllib2
import cgi
fs = cgi.FieldStorage()
url = fs.getvalue('url', "http://openlayers.org")
import sys, os
# Designed to prevent Open Proxy type stuff.
allowedHosts = ['www.openlayers.org', 'openlayers.org', 'octo.metacarta.com', 'merrimack.metacarta.com', 'labs.metacarta.com', 'world.freemap.in',
'prototype.openmnnd.org']
allowedHosts = ['www.openlayers.org', 'openlayers.org',
'labs.metacarta.com', 'world.freemap.in',
'prototype.openmnnd.org', 'geo.openplans.org']
method = os.environ["REQUEST_METHOD"]
if method == "POST":
qs = os.environ["QUERY_STRING"]
d = cgi.parse_qs(qs)
if d.has_key("url"):
url = d["url"][0]
else:
url = "http://www.openlayers.org"
else:
fs = cgi.FieldStorage()
url = fs.getvalue('url', "http://www.openlayers.org")
try:
host = url.split("/")[2]
@@ -30,24 +39,36 @@ try:
print "Content-Type: text/plain"
print
print "This proxy does not allow you to access that location."
print
print os.environ
elif url.startswith("http://") or url.startswith("https://"):
y = urllib.urlopen(url)
if method == "POST":
length = int(os.environ["CONTENT_LENGTH"])
headers = {"Content-Type": os.environ["CONTENT_TYPE"]}
body = sys.stdin.read(length)
r = urllib2.Request(url, body, headers)
y = urllib2.urlopen(r)
else:
y = urllib2.urlopen(url)
headers = str(y.info()).split('\n')
for h in headers:
if h.startswith("Content-Type:"):
print h
# print content type header
i = y.info()
if i.has_key("Content-Type"):
print "Content-Type: %s" % (i["Content-Type"])
else:
print "Content-Type: text/plain"
print
print y.read()
y.close()
else:
print """Content-Type: text/plain
print "Content-Type: text/plain"
print
print "Illegal request."
Illegal request."""
except Exception, E:
print "Status: 500 Unexpected Error"
print "Content-Type: text/plain"

View File

@@ -99,7 +99,7 @@
var vector = new OpenLayers.Layer.Vector("Editable Vectors");
map.addLayers([gmap, gsat, ghyb, veroad, veaer, vehyb,
yahoo, yahoosat, yahoohyb, mapnik, wms]);
yahoo, yahoosat, yahoohyb, mapnik, wms, vector]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.EditingToolbar(vector));
map.zoomToMaxExtent()

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/*

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,8 +1,15 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/BaseTypes/Class.js
* @requires OpenLayers/BaseTypes/LonLat.js
* @requires OpenLayers/BaseTypes/Size.js
* @requires OpenLayers/BaseTypes/Pixel.js
* @requires OpenLayers/BaseTypes/Bounds.js
* @requires OpenLayers/BaseTypes/Element.js
*
* Header: OpenLayers Base Types
* OpenLayers custom string, number and function functions are described here.
*/
@@ -16,7 +23,7 @@
OpenLayers.String = {
/**
* APIMethod: OpenLayers.String.startsWith
* Whether or not a string starts with another string.
* Test whether a string starts with another string.
*
* Parameters:
* str - {String} The string to test.
@@ -31,7 +38,7 @@ OpenLayers.String = {
/**
* APIMethod: OpenLayers.String.contains
* Whether or not a string contains another string.
* Test whether a string contains another string.
*
* Parameters:
* str - {String} The string to test.
@@ -53,7 +60,7 @@ OpenLayers.String = {
* modified.
*
* Returns:
* {String} A trimmed version of the string - all leading and
* {String} A trimmed version of the string with all leading and
* trailing spaces removed.
*/
trim: function(str) {
@@ -86,7 +93,7 @@ OpenLayers.String = {
if (!String.prototype.startsWith) {
/**
* APIMethod: String.startsWith
* Deprecated. Whether or not a string starts with another string.
* *Deprecated*. Whether or not a string starts with another string.
*
* Parameters:
* sStart - {Sring} The string we're testing for.
@@ -106,7 +113,7 @@ if (!String.prototype.startsWith) {
if (!String.prototype.contains) {
/**
* APIMethod: String.contains
* Deprecated. Whether or not a string contains another string.
* *Deprecated*. Whether or not a string contains another string.
*
* Parameters:
* str - {String} The string that we're testing for.
@@ -126,7 +133,7 @@ if (!String.prototype.contains) {
if (!String.prototype.trim) {
/**
* APIMethod: String.trim
* Deprecated. Removes leading and trailing whitespace characters from a string.
* *Deprecated*. Removes leading and trailing whitespace characters from a string.
*
* Returns:
* {String} A trimmed version of the string - all leading and
@@ -143,8 +150,8 @@ if (!String.prototype.trim) {
if (!String.prototype.camelize) {
/**
* APIMethod: camelize
* Deprecated. Camel-case a hyphenated string.
* APIMethod: String.camelize
* *Deprecated*. Camel-case a hyphenated string.
* Ex. "chicken-head" becomes "chickenHead", and
* "-chicken-head" becomes "ChickenHead".
*
@@ -193,7 +200,7 @@ OpenLayers.Number = {
if (!Number.prototype.limitSigDigs) {
/**
* APIMethod: Number.limitSigDigs
* Deprecated. Limit the number of significant digits on an integer. Does *not*
* *Deprecated*. Limit the number of significant digits on an integer. Does *not*
* work with floats!
*
* Parameters:
@@ -266,7 +273,7 @@ OpenLayers.Function = {
if (!Function.prototype.bind) {
/**
* APIMethod: Function.bind
* Deprecated. Bind a function to an object.
* *Deprecated*. Bind a function to an object.
* Method to easily create closures with 'this' altered.
*
* Parameters:
@@ -290,7 +297,7 @@ if (!Function.prototype.bind) {
if (!Function.prototype.bindAsEventListener) {
/**
* APIMethod: Function.bindAsEventListener
* Deprecated. Bind a function to an object, and configure it to receive the
* *Deprecated*. Bind a function to an object, and configure it to receive the
* event object as first parameter when called.
*
* Parameters:

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
@@ -7,12 +7,12 @@
* Instances of this class represent bounding boxes. Data stored as left,
* bottom, right, top floats. All values are initialized to null, however,
* you should make sure you set them before using the bounds for anything.
* Possible use case:
*
* Possible use case:
* > bounds = new OpenLayers.Bounds();
* > bounds.extend(new OpenLayers.LonLat(4,5));
* > bounds.extend(new OpenLayers.LonLat(5,6));
* > bounds.toBBOX() // returns 4,5,5,6
* > bounds.toBBOX(); // returns 4,5,5,6
*/
OpenLayers.Bounds = OpenLayers.Class({
@@ -81,13 +81,13 @@ OpenLayers.Bounds = OpenLayers.Class({
/**
* Method: equals
* Test a two bounds for equivalence
* Test a two bounds for equivalence.
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
*
* Returns:
* {Boolean} The passed-in OpenLayers.Bounds object has the same left,
* {Boolean} The passed-in bounds object has the same left,
* right, top, bottom components as this. Note that if bounds
* passed in is null, returns false.
*/
@@ -106,7 +106,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* APIMethod: toString
*
* Returns:
* {String} String representation of OpenLayers.Bounds object.
* {String} String representation of bounds object.
* (ex.<i>"left-bottom=(5,42) right-top=(10,45)"</i>)
*/
toString:function() {
@@ -132,7 +132,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* Default is 6
*
* Returns:
* {String} Simple String representation of OpenLayers.Bounds object.
* {String} Simple String representation of bounds object.
* (ex. <i>"5,42,10,45"</i>)
*/
toBBOX:function(decimal) {
@@ -162,7 +162,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* APIMethod: getHeight
*
* Returns:
* {Float} The height of the bounds
* {Float} The height of the bounds (top minus bottom).
*/
getHeight:function() {
return (this.top - this.bottom);
@@ -172,7 +172,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* APIMethod: getSize
*
* Returns:
* {<OpenLayers.Size>} An <OpenLayers.Size> which represents the size of the box
* {<OpenLayers.Size>} The size of the box.
*/
getSize:function() {
return new OpenLayers.Size(this.getWidth(), this.getHeight());
@@ -182,8 +182,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* APIMethod: getCenterPixel
*
* Returns:
* {<OpenLayers.Pixel>} An <OpenLayers.Pixel> which represents the center
* of the bounds
* {<OpenLayers.Pixel>} The center of the bounds in pixel space.
*/
getCenterPixel:function() {
return new OpenLayers.Pixel( (this.left + this.right) / 2,
@@ -194,8 +193,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* APIMethod: getCenterLonLat
*
* Returns:
* {<OpenLayers.LonLat>} An <OpenLayers.LonLat> which represents the center
* of the bounds
* {<OpenLayers.LonLat>} The center of the bounds in map space.
*/
getCenterLonLat:function() {
return new OpenLayers.LonLat( (this.left + this.right) / 2,
@@ -210,9 +208,8 @@ OpenLayers.Bounds = OpenLayers.Class({
* y - {Float}
*
* Returns:
* {<OpenLayers.Bounds>} A new <OpenLayers.Bounds> whose coordinates are
* the same as this, but shifted by the passed-in
* x and y values
* {<OpenLayers.Bounds>} A new bounds whose coordinates are the same as
* this, but shifted by the passed-in x and y values.
*/
add:function(x, y) {
if ( (x == null) || (y == null) ) {
@@ -227,8 +224,7 @@ OpenLayers.Bounds = OpenLayers.Class({
/**
* APIMethod: extend
* Extend the bounds to include the point, lonlat, or bounds specified.
* Note: This function assumes that left<right and bottom<top.
*
* Note, this function assumes that left < right and bottom < top.
*
* Parameters:
* object - {Object} Can be LonLat, Point, or Bounds
@@ -277,7 +273,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* Default is true.
*
* Returns:
* {Boolean} Whether or not the passed-in lonlat is within this bounds.
* {Boolean} The passed-in lonlat is within this bounds.
*/
containsLonLat:function(ll, inclusive) {
return this.contains(ll.lon, ll.lat, inclusive);
@@ -288,11 +284,11 @@ OpenLayers.Bounds = OpenLayers.Class({
*
* Parameters:
* px - {<OpenLayers.Pixel>}
* inclusive - {Boolean} Whether or not to include the border.
* Default is true.
* inclusive - {Boolean} Whether or not to include the border. Default is
* true.
*
* Returns:
* {Boolean} Whether or not the passed-in pixel is within this bounds.
* {Boolean} The passed-in pixel is within this bounds.
*/
containsPixel:function(px, inclusive) {
return this.contains(px.x, px.y, inclusive);
@@ -304,8 +300,8 @@ OpenLayers.Bounds = OpenLayers.Class({
* Parameters:
* x - {Float}
* y - {Float}
* inclusive - {Boolean} Whether or not to include the border.
* Default is true.
* inclusive - {Boolean} Whether or not to include the border. Default is
* true.
*
* Returns:
* {Boolean} Whether or not the passed-in coordinates are within this
@@ -334,13 +330,13 @@ OpenLayers.Bounds = OpenLayers.Class({
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* inclusive - {<Boolean>} Whether or not to include the border.
* Default is true.
* inclusive - {<Boolean>} Whether or not to include the border. Default
* is true.
*
* Returns:
* {Boolean} Whether or not the passed-in OpenLayers.Bounds object
* intersects this bounds. Simple math just check if either
* contains the other, allowing for partial.
* {Boolean} The passed-in OpenLayers.Bounds object intersects this bounds.
* Simple math just check if either contains the other, allowing for
* partial.
*/
intersectsBounds:function(bounds, inclusive) {
@@ -369,16 +365,14 @@ OpenLayers.Bounds = OpenLayers.Class({
* APIMethod: containsBounds
*
* bounds - {<OpenLayers.Bounds>}
* partial - {<Boolean>} If true, only part of passed-in
* <OpenLayers.Bounds> needs be within this bounds.
* If false, the entire passed-in bounds must be
* partial - {<Boolean>} If true, only part of passed-in bounds needs be
* within this bounds. If false, the entire passed-in bounds must be
* within. Default is false
* inclusive - {<Boolean>} Whether or not to include the border.
* Default is true.
* inclusive - {<Boolean>} Whether or not to include the border. Default is
* true.
*
* Returns:
* {Boolean} Whether or not the passed-in OpenLayers.Bounds object is
* contained within this bounds.
* {Boolean} The passed-in bounds object is contained within this bounds.
*/
containsBounds:function(bounds, partial, inclusive) {
@@ -418,8 +412,8 @@ OpenLayers.Bounds = OpenLayers.Class({
* lonlat - {<OpenLayers.LonLat>}
*
* Returns:
* {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which
* the coordinate lies.
* {String} The quadrant ("br" "tr" "tl" "bl") of the bounds in which the
* coordinate lies.
*/
determineQuadrant: function(lonlat) {
@@ -495,7 +489,7 @@ OpenLayers.Bounds = OpenLayers.Class({
* str - {String}Comma-separated bounds string. (ex. <i>"5,42,10,45"</i>)
*
* Returns:
* {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
* {<OpenLayers.Bounds>} New bounds object built from the
* passed-in String.
*/
OpenLayers.Bounds.fromString = function(str) {
@@ -512,8 +506,7 @@ OpenLayers.Bounds.fromString = function(str) {
* bbox - {Array(Float)} Array of bounds values (ex. <i>[5,42,10,45]</i>)
*
* Returns:
* {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
* passed-in Array.
* {<OpenLayers.Bounds>} New bounds object built from the passed-in Array.
*/
OpenLayers.Bounds.fromArray = function(bbox) {
return new OpenLayers.Bounds(parseFloat(bbox[0]),
@@ -531,8 +524,7 @@ OpenLayers.Bounds.fromArray = function(bbox) {
* size - {<OpenLayers.Size>}
*
* Returns:
* {<OpenLayers.Bounds>} New <OpenLayers.Bounds> object built from the
* passed-in size.
* {<OpenLayers.Bounds>} New bounds object built from the passed-in size.
*/
OpenLayers.Bounds.fromSize = function(size) {
return new OpenLayers.Bounds(0,

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
@@ -93,7 +93,7 @@ OpenLayers.Control = OpenLayers.Class({
/**
* Property: handler
* {<OpenLayers.Handler}> null
* {<OpenLayers.Handler>} null
*/
handler: null,

View File

@@ -1,5 +1,5 @@
/* Cpyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Cpyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -31,9 +31,9 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* that is about to be dragged and the pixel location of the mouse.
*
* Parameters:
* feature - {OpenLayers.Feature.Vector} The feature that is about to be
* feature - {<OpenLayers.Feature.Vector>} The feature that is about to be
* dragged.
* pixel - {OpenLayers.Pixel} The pixel location of the mouse.
* pixel - {<OpenLayers.Pixel>} The pixel location of the mouse.
*/
onStart: function(feature, pixel) {},
@@ -44,8 +44,8 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* feature that is being dragged and the pixel location of the mouse.
*
* Parameters:
* feature - {OpenLayers.Feature.Vector} The feature that was dragged.
* pixel - {OpenLayers.Pixel} The pixel location of the mouse.
* feature - {<OpenLayers.Feature.Vector>} The feature that was dragged.
* pixel - {<OpenLayers.Pixel>} The pixel location of the mouse.
*/
onDrag: function(feature, pixel) {},
@@ -57,26 +57,26 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* mouse.
*
* Parameters:
* feature - {OpenLayers.Feature.Vector} The feature that was dragged.
* pixel - {OpenLayers.Pixel} The pixel location of the mouse.
* feature - {<OpenLayers.Feature.Vector>} The feature that was dragged.
* pixel - {<OpenLayers.Pixel>} The pixel location of the mouse.
*/
onComplete: function(feature, pixel) {},
/**
* Property: layer
* {OpenLayers.Layer.Vector}
* {<OpenLayers.Layer.Vector>}
*/
layer: null,
/**
* Property: feature
* {OpenLayers.Feature.Vector}
* {<OpenLayers.Feature.Vector>}
*/
feature: null,
/**
* Property: dragHandler
* {OpenLayers.Handler.Drag}
* {<OpenLayers.Handler.Drag>}
*/
dragHandler: null,
@@ -88,7 +88,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* Property: featureHandler
* {OpenLayers.Handler.Feature}
* {<OpenLayers.Handler.Feature>}
*/
featureHandler: null,
@@ -100,7 +100,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* Property: lastPixel
* {OpenLayers.Pixel}
* {<OpenLayers.Pixel>}
*/
lastPixel: null,
@@ -109,7 +109,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* Create a new control to drag features.
*
* Parameters:
* layer - {OpenLayers.Layer.Vector} The layer containing features to be
* layer - {<OpenLayers.Layer.Vector>} The layer containing features to be
* dragged.
* options - {Object} Optional object whose properties will be set on the
* control.
@@ -179,7 +179,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* This activates the drag handler.
*
* Parameters:
* feature - {OpenLayers.Feature.Vector} The selected feature.
* feature - {<OpenLayers.Feature.Vector>} The selected feature.
*/
overFeature: function(feature) {
if(!this.dragHandler.dragging) {
@@ -202,7 +202,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* Called when the drag handler detects a mouse-down.
*
* Parameters:
* pixel - {OpenLayers.Pixel} Location of the mouse event.
* pixel - {<OpenLayers.Pixel>} Location of the mouse event.
*/
downFeature: function(pixel) {
this.lastPixel = pixel;
@@ -215,7 +215,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* optional onDrag method.
*
* Parameters:
* pixel - {OpenLayers.Pixel} Location of the mouse event.
* pixel - {<OpenLayers.Pixel>} Location of the mouse event.
*/
moveFeature: function(pixel) {
var res = this.map.getResolution();
@@ -232,7 +232,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* optional onComplete method.
*
* Parameters:
* pixel - {OpenLayers.Pixel} Location of the mouse event.
* pixel - {<OpenLayers.Pixel>} Location of the mouse event.
*/
upFeature: function(pixel) {
if(!this.over) {
@@ -248,7 +248,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* Called when the drag handler is done dragging.
*
* Parameters:
* pixel - {OpenLayers.Pixel} The last event pixel location. If this event
* pixel - {<OpenLayers.Pixel>} The last event pixel location. If this event
* came from a mouseout, this may not be in the map viewport.
*/
doneDragging: function(pixel) {
@@ -260,7 +260,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* Called when the feature handler detects a mouse-out on a feature.
*
* Parameters:
* feature - {OpenLayers.Feature.Vector} The feature that the mouse left.
* feature - {<OpenLayers.Feature.Vector>} The feature that the mouse left.
*/
outFeature: function(feature) {
if(!this.dragHandler.dragging) {
@@ -290,7 +290,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
* Set the map property for the control and all handlers.
*
* Parameters:
* map - {OpenLayers.Map} The control's map.
* map - {<OpenLayers.Map>} The control's map.
*/
setMap: function(map) {
this.dragHandler.setMap(map);

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -30,7 +30,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
/**
* Property: layer
* {OpenLayers.Layer.Vector}
* {<OpenLayers.Layer.Vector>}
*/
layer: null,
@@ -116,7 +116,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* Create a new modify feature control.
*
* Parameters:
* layer - {OpenLayers.Layer.Vector} Layer that contains features that
* layer - {<OpenLayers.Layer.Vector>} Layer that contains features that
* will be modified.
* options - {Object} Optional object whose properties will be set on the
* control.
@@ -450,7 +450,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
* Set the map property for the control and all handlers.
*
* Parameters:
* map - {OpenLayers.Map} The control's map.
* map - {<OpenLayers.Map>} The control's map.
*/
setMap: function(map) {
this.selectControl.setMap(map);

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -61,6 +61,16 @@ OpenLayers.Control.MousePosition = OpenLayers.Class(OpenLayers.Control, {
OpenLayers.Control.prototype.initialize.apply(this, arguments);
},
/**
* Method: destroy
*/
destroy: function() {
if (this.map) {
this.map.events.unregister('mousemove', this, this.redraw);
}
OpenLayers.Control.prototype.destroy.apply(this, arguments);
},
/**
* Method: draw
* {DOMElement}

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
@@ -53,7 +53,7 @@ OpenLayers.Control.OverviewMap = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: minRatio
* {Numver} The ratio of the overview map resolution to the main map
* {Float} The ratio of the overview map resolution to the main map
* resolution at which to zoom farther out on the overview map.
*/
minRatio: 8,

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -15,13 +15,13 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
/**
* APIProperty: slideFactor
* {Float}
* {Integer}
*/
slideFactor: 50,
/**
* Property: buttons
* Array of Button Divs
* {Array(DOMElement)} Array of Button Divs
*/
buttons: null,
@@ -32,9 +32,12 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
position: null,
/**
* Constructor: OpenLayers.PanZoom
* Constructor: OpenLayers.Control.PanZoom
*
* Parameters:
* options - {Object}
*/
initialize: function() {
initialize: function(options) {
this.position = new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,
OpenLayers.Control.PanZoom.Y);
OpenLayers.Control.prototype.initialize.apply(this, arguments);
@@ -61,7 +64,7 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
* px - {<OpenLayers.Pixel>}
*
* Returns:
* {DOMElement} A reference to the container div for the PanZoom control
* {DOMElement} A reference to the container div for the PanZoom control.
*/
draw: function(px) {
// initialize our internal div
@@ -179,5 +182,14 @@ OpenLayers.Control.PanZoom = OpenLayers.Class(OpenLayers.Control, {
CLASS_NAME: "OpenLayers.Control.PanZoom"
});
/**
* Constant: X
* {Integer}
*/
OpenLayers.Control.PanZoom.X = 4;
/**
* Constant: Y
* {Integer}
*/
OpenLayers.Control.PanZoom.Y = 4;

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
// TRASH THIS

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,11 +1,16 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Format/XML.js
* @requires OpenLayers/Feature/Vector.js
* @requires OpenLayers/Geometry.js
* @requires OpenLayers/Geometry/Point.js
* @requires OpenLayers/Geometry/MultiPoint.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Geometry/MultiLineString.js
* @requires OpenLayers/Geometry/Polygon.js
* @requires OpenLayers/Geometry/MultiPolygon.js
*
* Class: OpenLayers.Format.GML
* Read/Wite GML. Create a new instance with the <OpenLayers.Format.GML>
@@ -290,7 +295,7 @@ OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format.XML, {
// look for <gml:posList>
nodeList = this.getElementsByTagNameNS(node, this.gmlns, "posList");
if(nodeList.length > 0) {
coordString = nodeList[0].firstChild.nodeValue;
coordString = this.concatChildValues(nodeList[0]);
coordString = coordString.replace(this.regExes.trimSpace, "");
coords = coordString.split(this.regExes.splitSpace);
var dim = parseInt(nodeList[0].getAttribute("dimension"));
@@ -309,7 +314,7 @@ OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format.XML, {
nodeList = this.getElementsByTagNameNS(node, this.gmlns,
"coordinates");
if(nodeList.length > 0) {
coordString = nodeList[0].firstChild.nodeValue;
coordString = this.concatChildValues(nodeList[0]);
coordString = coordString.replace(this.regExes.trimSpace,
"");
coordString = coordString.replace(this.regExes.trimComma,
@@ -448,7 +453,8 @@ OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format.XML, {
grandchildren = child.childNodes;
if(grandchildren.length == 1) {
grandchild = grandchildren[0];
if(grandchild.nodeType == 3) {
if(grandchild.nodeType == 3 ||
grandchild.nodeType == 4) {
name = (child.prefix) ?
child.nodeName.split(":")[1] :
child.nodeName;

View File

@@ -1,9 +1,16 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Format/JSON.js
* @requires OpenLayers/Feature/Vector.js
* @requires OpenLayers/Geometry/Point.js
* @requires OpenLayers/Geometry/MultiPoint.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Geometry/MultiLineString.js
* @requires OpenLayers/Geometry/Polygon.js
* @requires OpenLayers/Geometry/MultiPolygon.js
*
* Class: OpenLayers.Format.GeoJSON
* Read and write GeoJSON. Create a new parser with the
@@ -86,9 +93,9 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
break;
case "GeometryCollection":
results = [];
for(var i=0; i<obj.members.length; ++i) {
for(var i=0; i<obj.geometries.length; ++i) {
try {
results.push(this.parseGeometry(obj.members[i]));
results.push(this.parseGeometry(obj.geometries[i]));
} catch(err) {
results = null;
OpenLayers.Console.error(err);
@@ -108,9 +115,9 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
}
break;
case "FeatureCollection":
for(var i=0; i<obj.members.length; ++i) {
for(var i=0; i<obj.features.length; ++i) {
try {
results.push(this.parseFeature(obj.members[i]));
results.push(this.parseFeature(obj.features[i]));
} catch(err) {
results = null;
OpenLayers.Console.error(err);
@@ -118,9 +125,9 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
}
break;
case "GeometryCollection":
for(var i=0; i<obj.members.length; ++i) {
for(var i=0; i<obj.geometries.length; ++i) {
try {
var geom = this.parseGeometry(obj.members[i]);
var geom = this.parseGeometry(obj.geometries[i]);
results.push(new OpenLayers.Feature.Vector(geom));
} catch(err) {
results = null;
@@ -429,28 +436,24 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
"type": null
};
if(obj instanceof Array) {
geojson.members = [];
if(obj[0] instanceof OpenLayers.Feature.Vector) {
geojson.features = [];
} else if (obj[0].CLASS_NAME.search("OpenLayers.Geometry") == 0) {
geojson.geometries = [];
}
for(var i=0; i<obj.length; ++i) {
var element = obj[i];
if(element instanceof OpenLayers.Feature.Vector) {
if(geojson.type == null) {
geojson.type = "FeatureCollection";
if(element.layer && element.layer.projection) {
var proj = element.layer.projection;
if(proj.match(/epsg:/i)) {
geojson.crs = {
"type": "EPSG",
"properties": {
"code": parseInt(proj.substring(proj.indexOf(":") + 1))
}
};
}
geojson.crs = this.createCRSObject(element);
}
} else if(geojson.type != "FeatureCollection") {
OpenLayers.Console.error("FeatureCollection only supports collections of features: " + element);
break;
}
geojson.members.push(this.extract.feature.apply(this, [element]));
geojson.features.push(this.extract.feature.apply(this, [element]));
} else if (element.CLASS_NAME.search("OpenLayers.Geometry") == 0) {
if(geojson.type == null) {
geojson.type = "GeometryCollection";
@@ -458,7 +461,7 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
OpenLayers.Console.error("GeometryCollection only supports collections of geometries: " + element);
break;
}
geojson.members.push(this.extract.geometry.apply(this, [element]));
geojson.geometries.push(this.extract.geometry.apply(this, [element]));
}
}
} else if (obj.CLASS_NAME.search("OpenLayers.Geometry") == 0) {
@@ -466,21 +469,48 @@ OpenLayers.Format.GeoJSON = OpenLayers.Class(OpenLayers.Format.JSON, {
} else if (obj instanceof OpenLayers.Feature.Vector) {
geojson = this.extract.feature.apply(this, [obj]);
if(obj.layer && obj.layer.projection) {
var proj = obj.layer.projection;
if(proj.match(/epsg:/i)) {
geojson.crs = {
"type": "EPSG",
"properties": {
"code": parseInt(proj.substring(proj.indexOf(":") + 1))
}
};
}
geojson.crs = this.createCRSObject(obj);
}
}
return OpenLayers.Format.JSON.prototype.write.apply(this,
[geojson, pretty]);
},
/**
* Method: createCRSObject
* Create the CRS object for an object.
*
* Parameters:
* object - {<OpenLayers.Feature.Vector>}
*
* Returns:
* {Object} An object which can be assigned to the crs property
* of a GeoJSON object.
*/
createCRSObject: function(object) {
var proj = object.layer.projection;
var crs = {}
if (proj.match(/epsg:/i)) {
var code = parseInt(proj.substring(proj.indexOf(":") + 1));
if (code == 4326) {
crs = {
"type": "OGC",
"properties": {
"urn": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
};
} else {
crs = {
"type": "EPSG",
"properties": {
"code": code
}
};
}
}
return crs;
},
/**
* Property: extract
* Object with properties corresponding to the GeoJSON types.

View File

@@ -1,10 +1,13 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Format.js
* @requires OpenLayers/Format/XML.js
* @requires OpenLayers/Feature/Vector.js
* @requires OpenLayers/Geometry/Point.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Geometry/Polygon.js
*
* Class: OpenLayers.Format.GeoRSS
* Read/write GeoRSS parser. Create a new instance with the
@@ -36,6 +39,13 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
*/
georssns: "http://www.georss.org/georss",
/**
* APIProperty: geons
* {String} W3C Geo namespace to use. Defaults to
* "http://www.w3.org/2003/01/geo/wgs84_pos#"
*/
geons: "http://www.w3.org/2003/01/geo/wgs84_pos#",
/**
* APIProperty: featureTitle
* {String} Default title for features. Defaults to "Untitled"

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,10 +1,14 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Format.js
* @requires OpenLayers/Format/XML.js
* @requires OpenLayers/Feature/Vector.js
* @requires OpenLayers/Geometry/Point.js
* @requires OpenLayers/Geometry/LineString.js
* @requires OpenLayers/Geometry/Polygon.js
* @requires OpenLayers/Geometry/Collection.js
*
* Class: OpenLayers.Format.KML
* Read/Wite KML. Create a new instance with the <OpenLayers.Format.KML>
@@ -45,6 +49,13 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
*/
extractAttributes: true,
/**
* Property: internalns
* {String} KML Namespace to use -- defaults to the namespace of the
* Placemark node being parsed, but falls back to kmlns.
*/
internalns: null,
/**
* Constructor: OpenLayers.Format.KML
* Create a new parser for KML.
@@ -79,7 +90,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
data = OpenLayers.Format.XML.prototype.read.apply(this, [data]);
}
var featureNodes = this.getElementsByTagNameNS(data,
this.kmlns,
'*',
"Placemark");
var numFeatures = featureNodes.length;
var features = new Array(numFeatures);
@@ -112,7 +123,10 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
var type, nodeList, geometry, parser;
for(var i=0; i<order.length; ++i) {
type = order[i];
nodeList = this.getElementsByTagNameNS(node, this.kmlns, type);
this.internalns = node.namespaceURI ?
node.namespaceURI : this.kmlns;
nodeList = this.getElementsByTagNameNS(node,
this.internalns, type);
if(nodeList.length > 0) {
// only deal with first geometry of this type
var parser = this.parseGeometry[type.toLowerCase()];
@@ -161,7 +175,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
* {<OpenLayers.Geometry.Point>} A point geometry.
*/
point: function(node) {
var nodeList = this.getElementsByTagNameNS(node, this.kmlns,
var nodeList = this.getElementsByTagNameNS(node, this.internalns,
"coordinates");
var coords = [];
if(nodeList.length > 0) {
@@ -196,7 +210,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
* {<OpenLayers.Geometry.LineString>} A linestring geometry.
*/
linestring: function(node, ring) {
var nodeList = this.getElementsByTagNameNS(node, this.kmlns,
var nodeList = this.getElementsByTagNameNS(node, this.internalns,
"coordinates");
var line = null;
if(nodeList.length > 0) {
@@ -250,7 +264,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
* {<OpenLayers.Geometry.Polygon>} A polygon geometry.
*/
polygon: function(node) {
var nodeList = this.getElementsByTagNameNS(node, this.kmlns,
var nodeList = this.getElementsByTagNameNS(node, this.internalns,
"LinearRing");
var numRings = nodeList.length;
var components = new Array(numRings);
@@ -279,7 +293,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
* node - {DOMElement} A KML MultiGeometry node.
*
* Returns:
* {<OpenLayers.Geometry.Polygon>} A geometry collection.
* {<OpenLayers.Geometry.Collection>} A geometry collection.
*/
multigeometry: function(node) {
var child, parser;
@@ -322,7 +336,7 @@ OpenLayers.Format.KML = OpenLayers.Class(OpenLayers.Format.XML, {
grandchildren = child.childNodes;
if(grandchildren.length == 1) {
grandchild = grandchildren[0];
if(grandchild.nodeType == 3) {
if(grandchild.nodeType == 3 || grandchild.nodeType == 4) {
name = (child.prefix) ?
child.nodeName.split(":")[1] :
child.nodeName;

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,9 +1,10 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
* @requires OpenLayers/Format.js
* @requires OpenLayers/Feature/Vector.js
*
* Class: OpenLayers.Format.WKT
* Class for reading and writing Well-Known Text. Create a new instance
@@ -38,8 +39,8 @@ OpenLayers.Format.WKT = OpenLayers.Class(OpenLayers.Format, {
/**
* Method: read
* Deserialize a WKT string and return an OpenLayers.Feature.Vector or an
* array of OpenLayers.Feature.Vector. Supports WKT for POINT, MULTIPOINT,
* Deserialize a WKT string and return a vector feature or an
* array of vector features. Supports WKT for POINT, MULTIPOINT,
* LINESTRING, MULTILINESTRING, POLYGON, MULTIPOLYGON, and
* GEOMETRYCOLLECTION.
*

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
@@ -257,6 +257,62 @@ OpenLayers.Format.XML = OpenLayers.Class(OpenLayers.Format, {
return attributeValue;
},
/**
* APIMethod: getChildValue
* Get the value of the first child node if it exists, or return an
* optional default string. Returns an empty string if no first child
* exists and no default value is supplied.
*
* Parameters:
* node - {DOMElement} The element used to look for a first child value.
* def - {String} Optional string to return in the event that no
* first child value exists.
*
* Returns:
* {String} The value of the first child of the given node.
*/
getChildValue: function(node, def) {
var value;
try {
value = node.firstChild.nodeValue;
} catch(e) {
value = (def != undefined) ? def : "";
}
return value;
},
/**
* APIMethod: concatChildValues
* Concatenate the value of all child nodes if any exist, or return an
* optional default string. Returns an empty string if no children
* exist and no default value is supplied. Not optimized for large
* numbers of child nodes.
*
* Parameters:
* node - {DOMElement} The element used to look for child values.
* def - {String} Optional string to return in the event that no
* child exist.
*
* Returns:
* {String} The concatenated value of all child nodes of the given node.
*/
concatChildValues: function(node, def) {
var value = "";
var child = node.firstChild;
var childValue;
while(child) {
childValue = child.nodeValue;
if(childValue) {
value += childValue;
}
child = child.nextSibling;
}
if(value == "" && def != undefined) {
value = def;
}
return value;
},
/**
* APIMethod: hasAttributeNS
* Determine whether a node has a particular attribute matching the given

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
@@ -143,9 +143,10 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Let the event propagate.
*/
mousedown: function (evt) {
var propagate = true;
this.dragging = false;
if (this.checkModifiers(evt) && OpenLayers.Event.isLeftClick(evt)) {
this.started = true;
this.dragging = false;
this.start = evt.xy;
this.last = evt.xy;
// TBD replace with CSS classes
@@ -159,9 +160,13 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
document.onselectstart = function() {return false;}
}
return false;
propagate = false;
} else {
this.started = false;
this.start = null;
this.last = null;
}
return true;
return propagate;
},
/**
@@ -253,13 +258,8 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
* {Boolean} Let the event propagate.
*/
click: function (evt) {
// throw away the first left click event that happens after a mouse up
if (this.dragging) {
this.dragging = false;
return false;
}
this.started = false;
return true;
// let the click event propagate only if the mouse moved
return (this.start == this.last);
},
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -284,7 +284,7 @@ OpenLayers.Handler.RegularPolygon = OpenLayers.Class(OpenLayers.Handler.Drag, {
* Calculate the angle based on settings.
*
* Parameters:
* point - {OpenLayers.Geometry.Point}
* point - {<OpenLayers.Geometry.Point>}
* evt - {Event}
*/
calculateAngle: function(point, evt) {

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -731,20 +731,24 @@ OpenLayers.Layer = OpenLayers.Class({
*
* Parameters:
* bounds - {<OpenLayers.Bounds>}
* closest - {Boolean} Find the zoom level that most closely fits the
* specified bounds. Note that this may result in a zoom that does
* not exactly contain the entire extent.
* Default is false.
*
* Returns:
* {Integer} The index of the zoomLevel (entry in the resolutions array)
* that still contains the passed-in extent. We do this by calculating
* the ideal resolution for the given exteng (based on the map size)
* and then find the smallest resolution that is greater than this
* ideal resolution.
* for the passed-in extent. We do this by calculating the ideal
* resolution for the given extent (based on the map size) and then
* calling getZoomForResolution(), passing along the 'closest'
* parameter.
*/
getZoomForExtent: function(extent) {
getZoomForExtent: function(extent, closest) {
var viewSize = this.map.getSize();
var idealResolution = Math.max( extent.getWidth() / viewSize.w,
extent.getHeight() / viewSize.h );
return this.getZoomForResolution(idealResolution);
return this.getZoomForResolution(idealResolution, closest);
},
/**
@@ -764,20 +768,36 @@ OpenLayers.Layer = OpenLayers.Class({
*
* Parameters:
* resolution - {Float}
* closest - {Boolean} Find the zoom level that corresponds to the absolute
* closest resolution, which may result in a zoom whose corresponding
* resolution is actually smaller than we would have desired (if this
* is being called from a getZoomForExtent() call, then this means that
* the returned zoom index might not actually contain the entire
* extent specified... but it'll be close).
* Default is false.
*
* Returns:
* {Integer} The index of the zoomLevel (entry in the resolutions array)
* that is the smallest resolution that is greater than the passed-in
* resolution.
* that corresponds to the best fit resolution given the passed in
* value and the 'closest' specification.
*/
getZoomForResolution: function(resolution) {
for(var i=1; i < this.resolutions.length; i++) {
if ( this.resolutions[i] < resolution) {
getZoomForResolution: function(resolution, closest) {
var diff;
var minDiff = Number.POSITIVE_INFINITY;
for(var i=0; i < this.resolutions.length; i++) {
if (closest) {
diff = Math.abs(this.resolutions[i] - resolution);
if (diff > minDiff) {
break;
}
minDiff = diff;
} else {
if (this.resolutions[i] < resolution) {
break;
}
}
return (i - 1);
}
return Math.max(0, i-1);
},
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -264,7 +264,8 @@ OpenLayers.Layer.Google = OpenLayers.Class(
* {GPoint} A GPoint specifying gLatLng translated into "Container" coords
*/
addContainerPxFunction: function() {
if (typeof GMap2 != "undefined" && !GMap2.fromLatLngToContainerPixel) {
if ( (typeof GMap2 != "undefined") &&
!GMap2.prototype.fromLatLngToContainerPixel) {
GMap2.prototype.fromLatLngToContainerPixel = function(gLatLng) {
@@ -272,8 +273,7 @@ OpenLayers.Layer.Google = OpenLayers.Class(
var gPoint = this.fromLatLngToDivPixel(gLatLng);
// locate the sliding "Div" div
// it seems like "b" is the main div
var div = this.b.firstChild.firstChild;
var div = this.getContainer().firstChild.firstChild;
// adjust by the offset of "Div" and voila!
gPoint.x += div.offsetLeft;

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**
@@ -186,7 +186,7 @@ OpenLayers.Layer.Image = OpenLayers.Class(OpenLayers.Layer, {
*/
setUrl: function(newUrl) {
this.url = newUrl;
this.draw();
this.tile.draw();
},
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -40,5 +40,29 @@ OpenLayers.Layer.MapServer.Untiled = OpenLayers.Class(OpenLayers.Layer.MapServer
OpenLayers.Console.warn(msg);
},
/**
* Method: clone
* Create a clone of this layer
*
* Returns:
* {<OpenLayers.Layer.MapServer.Untiled>} An exact clone of this layer
*/
clone: function (obj) {
if (obj == null) {
obj = new OpenLayers.Layer.MapServer.Untiled(this.name,
this.url,
this.params,
this.options);
}
//get all additions from superclasses
obj = OpenLayers.Layer.MapServer.prototype.clone.apply(this, [obj]);
// copy/set any non-init, non-simple values here
return obj;
},
CLASS_NAME: "OpenLayers.Layer.MapServer.Untiled"
});

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD licence.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD licence.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -13,6 +13,12 @@
*/
OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
/**
* APIProperty: serviceVersion
* {String}
*/
serviceVersion: "1.0.0",
/**
* APIProperty: isBaseLayer
* {Boolean}
@@ -91,7 +97,7 @@ OpenLayers.Layer.TMS = OpenLayers.Class(OpenLayers.Layer.Grid, {
var x = Math.round((bounds.left - this.tileOrigin.lon) / (res * this.tileSize.w));
var y = Math.round((bounds.bottom - this.tileOrigin.lat) / (res * this.tileSize.h));
var z = this.map.getZoom();
var path = "1.0.0" + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;
var path = this.serviceVersion + "/" + this.layername + "/" + z + "/" + x + "/" + y + "." + this.type;
var url = this.url;
if (url instanceof Array) {
url = this.selectUrl(path, url);

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD licence.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD licence.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
/**

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -255,6 +255,7 @@ OpenLayers.Layer.WFS = OpenLayers.Class(
this.tile = null;
this.tile = new OpenLayers.Tile.WFS(this, pos, tileBounds,
url, tileSize);
this.addTileMonitoringHooks(this.tile);
this.tile.draw();
}
}

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -40,5 +40,29 @@ OpenLayers.Layer.WMS.Untiled = OpenLayers.Class(OpenLayers.Layer.WMS, {
OpenLayers.Console.warn(msg);
},
/**
* Method: clone
* Create a clone of this layer
*
* Returns:
* {<OpenLayers.Layer.WMS.Untiled>} An exact clone of this layer
*/
clone: function (obj) {
if (obj == null) {
obj = new OpenLayers.Layer.WMS.Untiled(this.name,
this.url,
this.params,
this.options);
}
//get all additions from superclasses
obj = OpenLayers.Layer.WMS.prototype.clone.apply(this, [obj]);
// copy/set any non-init, non-simple values here
return obj;
},
CLASS_NAME: "OpenLayers.Layer.WMS.Untiled"
});

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */

View File

@@ -1,5 +1,5 @@
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under a modified BSD license.
* See http://svn.openlayers.org/trunk/openlayers/repository-license.txt
/* Copyright (c) 2006-2007 MetaCarta, Inc., published under the BSD license.
* See http://svn.openlayers.org/trunk/openlayers/release-license.txt
* for the full text of the license. */
@@ -91,6 +91,7 @@ OpenLayers.Layer.Yahoo = OpenLayers.Class(
var size = this.getMapObjectSizeFromOLSize(this.map.getSize());
this.mapObject = new YMap(this.div, this.type, size);
this.mapObject.disableKeyControls();
this.mapObject.disableDragMap();
} catch(e) {}
},

Some files were not shown because too many files have changed in this diff Show More