more tests and some fixes

This commit is contained in:
Dennis Eichhorn 2024-04-24 03:20:47 +00:00
parent d24bcd69e9
commit 8525cb7415
14 changed files with 17850 additions and 15824 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
* - <OpenLayers.Format.XML> * - <OpenLayers.Format.XML>
*/ */
OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, { OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
/** /**
* Property: namespaces * Property: namespaces
* {Object} Mapping of namespace aliases to namespace URIs. Properties * {Object} Mapping of namespace aliases to namespace URIs. Properties
@ -30,7 +30,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
atom: "http://www.w3.org/2005/Atom", atom: "http://www.w3.org/2005/Atom",
georss: "http://www.georss.org/georss" georss: "http://www.georss.org/georss"
}, },
/** /**
* APIProperty: feedTitle * APIProperty: feedTitle
* {String} Atom feed elements require a title. Default is "untitled". * {String} Atom feed elements require a title. Default is "untitled".
@ -51,14 +51,14 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
* Non-API and only created if necessary * Non-API and only created if necessary
*/ */
gmlParser: null, gmlParser: null,
/** /**
* APIProperty: xy * APIProperty: xy
* {Boolean} Order of the GML coordinate: true:(x,y) or false:(y,x) * {Boolean} Order of the GML coordinate: true:(x,y) or false:(y,x)
* For GeoRSS the default is (y,x), therefore: false * For GeoRSS the default is (y,x), therefor: false
*/ */
xy: false, xy: false,
/** /**
* Constructor: OpenLayers.Format.AtomEntry * Constructor: OpenLayers.Format.AtomEntry
* Create a new parser for Atom. * Create a new parser for Atom.
@ -67,11 +67,11 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
* options - {Object} An optional object whose properties will be set on * options - {Object} An optional object whose properties will be set on
* this instance. * this instance.
*/ */
/** /**
* APIMethod: read * APIMethod: read
* Return a list of features from an Atom feed or entry document. * Return a list of features from an Atom feed or entry document.
* Parameters: * Parameters:
* doc - {Element} or {String} * doc - {Element} or {String}
* *
@ -84,7 +84,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return this.parseFeatures(doc); return this.parseFeatures(doc);
}, },
/** /**
* APIMethod: write * APIMethod: write
* Serialize or more feature nodes to Atom documents. * Serialize or more feature nodes to Atom documents.
@ -114,7 +114,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return OpenLayers.Format.XML.prototype.write.apply(this, [doc]); return OpenLayers.Format.XML.prototype.write.apply(this, [doc]);
}, },
/** /**
* Method: buildContentNode * Method: buildContentNode
* *
@ -160,7 +160,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return node; return node;
}, },
/** /**
* Method: buildEntryNode * Method: buildEntryNode
* Build an Atom entry node from a feature object. * Build an Atom entry node from a feature object.
@ -179,7 +179,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
var attrib = feature.attributes; var attrib = feature.attributes;
var atomAttrib = attrib.atom || {}; var atomAttrib = attrib.atom || {};
var entryNode = this.createElementNSPlus("atom:entry"); var entryNode = this.createElementNSPlus("atom:entry");
// atom:author // atom:author
if (atomAttrib.authors) { if (atomAttrib.authors) {
var authors = OpenLayers.Util.isArray(atomAttrib.authors) ? var authors = OpenLayers.Util.isArray(atomAttrib.authors) ?
@ -192,7 +192,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
); );
} }
} }
// atom:category // atom:category
if (atomAttrib.categories) { if (atomAttrib.categories) {
var categories = OpenLayers.Util.isArray(atomAttrib.categories) ? var categories = OpenLayers.Util.isArray(atomAttrib.categories) ?
@ -211,12 +211,12 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
); );
} }
} }
// atom:content // atom:content
if (atomAttrib.content) { if (atomAttrib.content) {
entryNode.appendChild(this.buildContentNode(atomAttrib.content)); entryNode.appendChild(this.buildContentNode(atomAttrib.content));
} }
// atom:contributor // atom:contributor
if (atomAttrib.contributors) { if (atomAttrib.contributors) {
var contributors = OpenLayers.Util.isArray(atomAttrib.contributors) ? var contributors = OpenLayers.Util.isArray(atomAttrib.contributors) ?
@ -230,7 +230,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
); );
} }
} }
// atom:id // atom:id
if (feature.fid) { if (feature.fid) {
entryNode.appendChild( entryNode.appendChild(
@ -239,7 +239,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
}) })
); );
} }
// atom:link // atom:link
if (atomAttrib.links) { if (atomAttrib.links) {
var links = OpenLayers.Util.isArray(atomAttrib.links) ? var links = OpenLayers.Util.isArray(atomAttrib.links) ?
@ -261,7 +261,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
); );
} }
} }
// atom:published // atom:published
if (atomAttrib.published) { if (atomAttrib.published) {
entryNode.appendChild( entryNode.appendChild(
@ -270,7 +270,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
}) })
); );
} }
// atom:rights // atom:rights
if (atomAttrib.rights) { if (atomAttrib.rights) {
entryNode.appendChild( entryNode.appendChild(
@ -279,9 +279,9 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
}) })
); );
} }
// atom:source not implemented // atom:source not implemented
// atom:summary // atom:summary
if (atomAttrib.summary || attrib.description) { if (atomAttrib.summary || attrib.description) {
entryNode.appendChild( entryNode.appendChild(
@ -290,14 +290,14 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
}) })
); );
} }
// atom:title // atom:title
entryNode.appendChild( entryNode.appendChild(
this.createElementNSPlus("atom:title", { this.createElementNSPlus("atom:title", {
value: atomAttrib.title || attrib.title || this.defaultEntryTitle value: atomAttrib.title || attrib.title || this.defaultEntryTitle
}) })
); );
// atom:updated // atom:updated
if (atomAttrib.updated) { if (atomAttrib.updated) {
entryNode.appendChild( entryNode.appendChild(
@ -306,7 +306,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
}) })
); );
} }
// georss:where // georss:where
if (feature.geometry) { if (feature.geometry) {
var whereNode = this.createElementNSPlus("georss:where"); var whereNode = this.createElementNSPlus("georss:where");
@ -315,10 +315,10 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
); );
entryNode.appendChild(whereNode); entryNode.appendChild(whereNode);
} }
return entryNode; return entryNode;
}, },
/** /**
* Method: initGmlParser * Method: initGmlParser
* Creates a GML parser. * Creates a GML parser.
@ -331,7 +331,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
externalProjection: this.externalProjection externalProjection: this.externalProjection
}); });
}, },
/** /**
* Method: buildGeometryNode * Method: buildGeometryNode
* builds a GeoRSS node with a given geometry * builds a GeoRSS node with a given geometry
@ -349,7 +349,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
var node = this.gmlParser.writeNode("feature:_geometry", geometry); var node = this.gmlParser.writeNode("feature:_geometry", geometry);
return node.firstChild; return node.firstChild;
}, },
/** /**
* Method: buildPersonConstructNode * Method: buildPersonConstructNode
* *
@ -385,7 +385,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return personNode; return personNode;
}, },
/** /**
* Method: getFirstChildValue * Method: getFirstChildValue
* *
@ -409,7 +409,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return value; return value;
}, },
/** /**
* Method: parseFeature * Method: parseFeature
* Parse feature from an Atom entry node.. * Parse feature from an Atom entry node..
@ -426,10 +426,10 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
var nodes = null; var nodes = null;
var attval = null; var attval = null;
var atomns = this.namespaces.atom; var atomns = this.namespaces.atom;
// atomAuthor* // atomAuthor*
this.parsePersonConstructs(node, "author", atomAttrib); this.parsePersonConstructs(node, "author", atomAttrib);
// atomCategory* // atomCategory*
nodes = this.getElementsByTagNameNS(node, atomns, "category"); nodes = this.getElementsByTagNameNS(node, atomns, "category");
if (nodes.length > 0) { if (nodes.length > 0) {
@ -444,7 +444,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
if (attval) { value.label = attval; } if (attval) { value.label = attval; }
atomAttrib.categories.push(value); atomAttrib.categories.push(value);
} }
// atomContent? // atomContent?
nodes = this.getElementsByTagNameNS(node, atomns, "content"); nodes = this.getElementsByTagNameNS(node, atomns, "content");
if (nodes.length > 0) { if (nodes.length > 0) {
@ -457,8 +457,8 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
if (attval) { if (attval) {
value.src = attval; value.src = attval;
} else { } else {
if (value.type == "text" || if (value.type == "text" ||
value.type == "html" || value.type == "html" ||
value.type == null ) { value.type == null ) {
value.value = this.getFirstChildValue( value.value = this.getFirstChildValue(
node, node,
@ -480,13 +480,13 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
atomAttrib.content = value; atomAttrib.content = value;
} }
} }
// atomContributor* // atomContributor*
this.parsePersonConstructs(node, "contributor", atomAttrib); this.parsePersonConstructs(node, "contributor", atomAttrib);
// atomId // atomId
atomAttrib.id = this.getFirstChildValue(node, atomns, "id", null); atomAttrib.id = this.getFirstChildValue(node, atomns, "id", null);
// atomLink* // atomLink*
nodes = this.getElementsByTagNameNS(node, atomns, "link"); nodes = this.getElementsByTagNameNS(node, atomns, "link");
if (nodes.length > 0) { if (nodes.length > 0) {
@ -504,37 +504,37 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
atomAttrib.links[i] = value; atomAttrib.links[i] = value;
} }
// atomPublished? // atomPublished?
value = this.getFirstChildValue(node, atomns, "published", null); value = this.getFirstChildValue(node, atomns, "published", null);
if (value) { if (value) {
atomAttrib.published = value; atomAttrib.published = value;
} }
// atomRights? // atomRights?
value = this.getFirstChildValue(node, atomns, "rights", null); value = this.getFirstChildValue(node, atomns, "rights", null);
if (value) { if (value) {
atomAttrib.rights = value; atomAttrib.rights = value;
} }
// atomSource? -- not implemented // atomSource? -- not implemented
// atomSummary? // atomSummary?
value = this.getFirstChildValue(node, atomns, "summary", null); value = this.getFirstChildValue(node, atomns, "summary", null);
if (value) { if (value) {
atomAttrib.summary = value; atomAttrib.summary = value;
} }
// atomTitle // atomTitle
atomAttrib.title = this.getFirstChildValue( atomAttrib.title = this.getFirstChildValue(
node, atomns, "title", null node, atomns, "title", null
); );
// atomUpdated // atomUpdated
atomAttrib.updated = this.getFirstChildValue( atomAttrib.updated = this.getFirstChildValue(
node, atomns, "updated", null node, atomns, "updated", null
); );
var featureAttrib = { var featureAttrib = {
title: atomAttrib.title, title: atomAttrib.title,
description: atomAttrib.summary, description: atomAttrib.summary,
@ -545,7 +545,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
feature.fid = atomAttrib.id; feature.fid = atomAttrib.id;
return feature; return feature;
}, },
/** /**
* Method: parseFeatures * Method: parseFeatures
* Return features from an Atom entry or feed. * Return features from an Atom entry or feed.
@ -569,7 +569,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return features; return features;
}, },
/** /**
* Method: parseLocations * Method: parseLocations
* Parse the locations from an Atom entry or feed. * Parse the locations from an Atom entry or feed.
@ -593,7 +593,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
this.gmlParser.readChildNodes(where[i], locations); this.gmlParser.readChildNodes(where[i], locations);
} }
} }
var components = locations.components; var components = locations.components;
var point = this.getElementsByTagNameNS(node, georssns, "point"); var point = this.getElementsByTagNameNS(node, georssns, "point");
if (point && point.length > 0) { if (point && point.length > 0) {
@ -628,7 +628,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
new OpenLayers.Geometry.LineString(points) new OpenLayers.Geometry.LineString(points)
); );
} }
} }
var polygon = this.getElementsByTagNameNS(node, georssns, "polygon"); var polygon = this.getElementsByTagNameNS(node, georssns, "polygon");
if (polygon && polygon.length > 0) { if (polygon && polygon.length > 0) {
@ -651,7 +651,7 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
); );
} }
} }
if (this.internalProjection && this.externalProjection) { if (this.internalProjection && this.externalProjection) {
for (var i=0, ii=components.length; i<ii; i++) { for (var i=0, ii=components.length; i<ii; i++) {
if (components[i]) { if (components[i]) {
@ -662,10 +662,10 @@ OpenLayers.Format.Atom = OpenLayers.Class(OpenLayers.Format.XML, {
} }
} }
} }
return components; return components;
}, },
/** /**
* Method: parsePersonConstruct * Method: parsePersonConstruct
* Parse Atom person constructs from an Atom entry node. * Parse Atom person constructs from an Atom entry node.

View File

@ -13,28 +13,28 @@
/** /**
* Class: OpenLayers.Format.GeoRSS * Class: OpenLayers.Format.GeoRSS
* Read/write GeoRSS parser. Create a new instance with the * Read/write GeoRSS parser. Create a new instance with the
* <OpenLayers.Format.GeoRSS> constructor. * <OpenLayers.Format.GeoRSS> constructor.
* *
* Inherits from: * Inherits from:
* - <OpenLayers.Format.XML> * - <OpenLayers.Format.XML>
*/ */
OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, { OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
/** /**
* APIProperty: rssns * APIProperty: rssns
* {String} RSS namespace to use. Defaults to * {String} RSS namespace to use. Defaults to
* "http://backend.userland.com/rss2" * "http://backend.userland.com/rss2"
*/ */
rssns: "http://backend.userland.com/rss2", rssns: "http://backend.userland.com/rss2",
/** /**
* APIProperty: featurens * APIProperty: featurens
* {String} Feature Attributes namespace. Defaults to * {String} Feature Attributes namespace. Defaults to
* "http://mapserver.gis.umn.edu/mapserver" * "http://mapserver.gis.umn.edu/mapserver"
*/ */
featureNS: "http://mapserver.gis.umn.edu/mapserver", featureNS: "http://mapserver.gis.umn.edu/mapserver",
/** /**
* APIProperty: georssns * APIProperty: georssns
* {String} GeoRSS namespace to use. Defaults to * {String} GeoRSS namespace to use. Defaults to
@ -48,19 +48,19 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
* "http://www.w3.org/2003/01/geo/wgs84_pos#" * "http://www.w3.org/2003/01/geo/wgs84_pos#"
*/ */
geons: "http://www.w3.org/2003/01/geo/wgs84_pos#", geons: "http://www.w3.org/2003/01/geo/wgs84_pos#",
/** /**
* APIProperty: featureTitle * APIProperty: featureTitle
* {String} Default title for features. Defaults to "Untitled" * {String} Default title for features. Defaults to "Untitled"
*/ */
featureTitle: "Untitled", featureTitle: "Untitled",
/** /**
* APIProperty: featureDescription * APIProperty: featureDescription
* {String} Default description for features. Defaults to "No Description" * {String} Default description for features. Defaults to "No Description"
*/ */
featureDescription: "No Description", featureDescription: "No Description",
/** /**
* Property: gmlParse * Property: gmlParse
* {Object} GML Format object for parsing features * {Object} GML Format object for parsing features
@ -71,10 +71,10 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
/** /**
* APIProperty: xy * APIProperty: xy
* {Boolean} Order of the GML coordinate: true:(x,y) or false:(y,x) * {Boolean} Order of the GML coordinate: true:(x,y) or false:(y,x)
* For GeoRSS the default is (y,x), therefore: false * For GeoRSS the default is (y,x), therefor: false
*/ */
xy: false, xy: false,
/** /**
* Constructor: OpenLayers.Format.GeoRSS * Constructor: OpenLayers.Format.GeoRSS
* Create a new parser for GeoRSS. * Create a new parser for GeoRSS.
@ -83,7 +83,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
* options - {Object} An optional object whose properties will be set on * options - {Object} An optional object whose properties will be set on
* this instance. * this instance.
*/ */
/** /**
* Method: createGeometryFromItem * Method: createGeometryFromItem
* Return a geometry from a GeoRSS Item. * Return a geometry from a GeoRSS Item.
@ -98,18 +98,18 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
var point = this.getElementsByTagNameNS(item, this.georssns, "point"); var point = this.getElementsByTagNameNS(item, this.georssns, "point");
var lat = this.getElementsByTagNameNS(item, this.geons, 'lat'); var lat = this.getElementsByTagNameNS(item, this.geons, 'lat');
var lon = this.getElementsByTagNameNS(item, this.geons, 'long'); var lon = this.getElementsByTagNameNS(item, this.geons, 'long');
var line = this.getElementsByTagNameNS(item, var line = this.getElementsByTagNameNS(item,
this.georssns, this.georssns,
"line"); "line");
var polygon = this.getElementsByTagNameNS(item, var polygon = this.getElementsByTagNameNS(item,
this.georssns, this.georssns,
"polygon"); "polygon");
var where = this.getElementsByTagNameNS(item, var where = this.getElementsByTagNameNS(item,
this.georssns, this.georssns,
"where"); "where");
var box = this.getElementsByTagNameNS(item, var box = this.getElementsByTagNameNS(item,
this.georssns, this.georssns,
"box"); "box");
if (point.length > 0 || (lat.length > 0 && lon.length > 0)) { if (point.length > 0 || (lat.length > 0 && lon.length > 0)) {
@ -124,29 +124,29 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
} else { } else {
location = [parseFloat(lat[0].firstChild.nodeValue), location = [parseFloat(lat[0].firstChild.nodeValue),
parseFloat(lon[0].firstChild.nodeValue)]; parseFloat(lon[0].firstChild.nodeValue)];
} }
var geometry = new OpenLayers.Geometry.Point(location[1], location[0]); var geometry = new OpenLayers.Geometry.Point(location[1], location[0]);
} else if (line.length > 0) { } else if (line.length > 0) {
var coords = OpenLayers.String.trim(this.getChildValue(line[0])).split(/\s+/); var coords = OpenLayers.String.trim(this.getChildValue(line[0])).split(/\s+/);
var components = []; var components = [];
var point; var point;
for (var i=0, len=coords.length; i<len; i+=2) { for (var i=0, len=coords.length; i<len; i+=2) {
point = new OpenLayers.Geometry.Point(coords[i+1], coords[i]); point = new OpenLayers.Geometry.Point(coords[i+1], coords[i]);
components.push(point); components.push(point);
} }
geometry = new OpenLayers.Geometry.LineString(components); geometry = new OpenLayers.Geometry.LineString(components);
} else if (polygon.length > 0) { } else if (polygon.length > 0) {
var coords = OpenLayers.String.trim(this.getChildValue(polygon[0])).split(/\s+/); var coords = OpenLayers.String.trim(this.getChildValue(polygon[0])).split(/\s+/);
var components = []; var components = [];
var point; var point;
for (var i=0, len=coords.length; i<len; i+=2) { for (var i=0, len=coords.length; i<len; i+=2) {
point = new OpenLayers.Geometry.Point(coords[i+1], coords[i]); point = new OpenLayers.Geometry.Point(coords[i+1], coords[i]);
components.push(point); components.push(point);
} }
geometry = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(components)]); geometry = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(components)]);
} else if (where.length > 0) { } else if (where.length > 0) {
if (!this.gmlParser) { if (!this.gmlParser) {
this.gmlParser = new OpenLayers.Format.GML({'xy': this.xy}); this.gmlParser = new OpenLayers.Format.GML({'xy': this.xy});
} }
@ -170,14 +170,14 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
} }
geometry = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(components)]); geometry = new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(components)]);
} }
if (geometry && this.internalProjection && this.externalProjection) { if (geometry && this.internalProjection && this.externalProjection) {
geometry.transform(this.externalProjection, geometry.transform(this.externalProjection,
this.internalProjection); this.internalProjection);
} }
return geometry; return geometry;
}, },
/** /**
* Method: createFeatureFromItem * Method: createFeatureFromItem
@ -191,10 +191,10 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
*/ */
createFeatureFromItem: function(item) { createFeatureFromItem: function(item) {
var geometry = this.createGeometryFromItem(item); var geometry = this.createGeometryFromItem(item);
/* Provide defaults for title and description */ /* Provide defaults for title and description */
var title = this._getChildValue(item, "*", "title", this.featureTitle); var title = this._getChildValue(item, "*", "title", this.featureTitle);
/* First try RSS descriptions, then Atom summaries */ /* First try RSS descriptions, then Atom summaries */
var description = this._getChildValue( var description = this._getChildValue(
item, "*", "description", item, "*", "description",
@ -213,7 +213,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
} }
var id = this._getChildValue(item, "*", "id", null); var id = this._getChildValue(item, "*", "id", null);
var data = { var data = {
"title": title, "title": title,
"description": description, "description": description,
@ -222,8 +222,8 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
var feature = new OpenLayers.Feature.Vector(geometry, data); var feature = new OpenLayers.Feature.Vector(geometry, data);
feature.fid = id; feature.fid = id;
return feature; return feature;
}, },
/** /**
* Method: _getChildValue * Method: _getChildValue
* *
@ -248,19 +248,19 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return value; return value;
}, },
/** /**
* APIMethod: read * APIMethod: read
* Return a list of features from a GeoRSS doc * Return a list of features from a GeoRSS doc
* *
* Parameters: * Parameters:
* doc - {Element} * doc - {Element}
* *
* Returns: * Returns:
* {Array(<OpenLayers.Feature.Vector>)} * {Array(<OpenLayers.Feature.Vector>)}
*/ */
read: function(doc) { read: function(doc) {
if (typeof doc == "string") { if (typeof doc == "string") {
doc = OpenLayers.Format.XML.prototype.read.apply(this, [doc]); doc = OpenLayers.Format.XML.prototype.read.apply(this, [doc]);
} }
@ -270,7 +270,7 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
if (itemlist.length == 0) { if (itemlist.length == 0) {
itemlist = this.getElementsByTagNameNS(doc, '*', 'entry'); itemlist = this.getElementsByTagNameNS(doc, '*', 'entry');
} }
var numItems = itemlist.length; var numItems = itemlist.length;
var features = new Array(numItems); var features = new Array(numItems);
for(var i=0; i<numItems; i++) { for(var i=0; i<numItems; i++) {
@ -278,13 +278,13 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
} }
return features; return features;
}, },
/** /**
* APIMethod: write * APIMethod: write
* Accept Feature Collection, and return a string. * Accept Feature Collection, and return a string.
* *
* Parameters: * Parameters:
* features - {Array(<OpenLayers.Feature.Vector>)} List of features to serialize into a string. * features - {Array(<OpenLayers.Feature.Vector>)} List of features to serialize into a string.
*/ */
write: function(features) { write: function(features) {
@ -303,9 +303,9 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
/** /**
* Method: createFeatureXML * Method: createFeatureXML
* Accept an <OpenLayers.Feature.Vector>, and build a geometry for it. * Accept an <OpenLayers.Feature.Vector>, and build a geometry for it.
* *
* Parameters: * Parameters:
* feature - {<OpenLayers.Feature.Vector>} * feature - {<OpenLayers.Feature.Vector>}
* *
* Returns: * Returns:
* {DOMElement} * {DOMElement}
@ -323,26 +323,26 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
var linkNode = this.createElementNS(this.rssns, "link"); var linkNode = this.createElementNS(this.rssns, "link");
linkNode.appendChild(this.createTextNode(feature.attributes.link)); linkNode.appendChild(this.createTextNode(feature.attributes.link));
featureNode.appendChild(linkNode); featureNode.appendChild(linkNode);
} }
for(var attr in feature.attributes) { for(var attr in feature.attributes) {
if (attr == "link" || attr == "title" || attr == "description") { continue; } if (attr == "link" || attr == "title" || attr == "description") { continue; }
var attrText = this.createTextNode(feature.attributes[attr]); var attrText = this.createTextNode(feature.attributes[attr]);
var nodename = attr; var nodename = attr;
if (attr.search(":") != -1) { if (attr.search(":") != -1) {
nodename = attr.split(":")[1]; nodename = attr.split(":")[1];
} }
var attrContainer = this.createElementNS(this.featureNS, "feature:"+nodename); var attrContainer = this.createElementNS(this.featureNS, "feature:"+nodename);
attrContainer.appendChild(attrText); attrContainer.appendChild(attrText);
featureNode.appendChild(attrContainer); featureNode.appendChild(attrContainer);
} }
featureNode.appendChild(geometryNode); featureNode.appendChild(geometryNode);
return featureNode; return featureNode;
}, },
/** /**
* Method: buildGeometryNode * Method: buildGeometryNode
* builds a GeoRSS node with a given geometry * builds a GeoRSS node with a given geometry
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* *
@ -352,20 +352,20 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
buildGeometryNode: function(geometry) { buildGeometryNode: function(geometry) {
if (this.internalProjection && this.externalProjection) { if (this.internalProjection && this.externalProjection) {
geometry = geometry.clone(); geometry = geometry.clone();
geometry.transform(this.internalProjection, geometry.transform(this.internalProjection,
this.externalProjection); this.externalProjection);
} }
var node; var node;
// match Polygon // match Polygon
if (geometry.CLASS_NAME == "OpenLayers.Geometry.Polygon") { if (geometry.CLASS_NAME == "OpenLayers.Geometry.Polygon") {
node = this.createElementNS(this.georssns, 'georss:polygon'); node = this.createElementNS(this.georssns, 'georss:polygon');
node.appendChild(this.buildCoordinatesNode(geometry.components[0])); node.appendChild(this.buildCoordinatesNode(geometry.components[0]));
} }
// match LineString // match LineString
else if (geometry.CLASS_NAME == "OpenLayers.Geometry.LineString") { else if (geometry.CLASS_NAME == "OpenLayers.Geometry.LineString") {
node = this.createElementNS(this.georssns, 'georss:line'); node = this.createElementNS(this.georssns, 'georss:line');
node.appendChild(this.buildCoordinatesNode(geometry)); node.appendChild(this.buildCoordinatesNode(geometry));
} }
// match Point // match Point
@ -374,19 +374,19 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
node.appendChild(this.buildCoordinatesNode(geometry)); node.appendChild(this.buildCoordinatesNode(geometry));
} else { } else {
throw "Couldn't parse " + geometry.CLASS_NAME; throw "Couldn't parse " + geometry.CLASS_NAME;
} }
return node; return node;
}, },
/** /**
* Method: buildCoordinatesNode * Method: buildCoordinatesNode
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
*/ */
buildCoordinatesNode: function(geometry) { buildCoordinatesNode: function(geometry) {
var points = null; var points = null;
if (geometry.components) { if (geometry.components) {
points = geometry.components; points = geometry.components;
} }
@ -405,5 +405,5 @@ OpenLayers.Format.GeoRSS = OpenLayers.Class(OpenLayers.Format.XML, {
return this.createTextNode(path); return this.createTextNode(path);
}, },
CLASS_NAME: "OpenLayers.Format.GeoRSS" CLASS_NAME: "OpenLayers.Format.GeoRSS"
}); });

View File

@ -11,40 +11,40 @@
/** /**
* Class: OpenLayers.Layer.GeoRSS * Class: OpenLayers.Layer.GeoRSS
* Add GeoRSS Point features to your map. * Add GeoRSS Point features to your map.
* *
* Inherits from: * Inherits from:
* - <OpenLayers.Layer.Markers> * - <OpenLayers.Layer.Markers>
*/ */
OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, { OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
/** /**
* Property: location * Property: location
* {String} store url of text file * {String} store url of text file
*/ */
location: null, location: null,
/** /**
* Property: features * Property: features
* {Array(<OpenLayers.Feature>)} * {Array(<OpenLayers.Feature>)}
*/ */
features: null, features: null,
/** /**
* APIProperty: formatOptions * APIProperty: formatOptions
* {Object} Hash of options which should be passed to the format when it is * {Object} Hash of options which should be passed to the format when it is
* created. Must be passed in the constructor. * created. Must be passed in the constructor.
*/ */
formatOptions: null, formatOptions: null,
/** /**
* Property: selectedFeature * Property: selectedFeature
* {<OpenLayers.Feature>} * {<OpenLayers.Feature>}
*/ */
selectedFeature: null, selectedFeature: null,
/** /**
* APIProperty: icon * APIProperty: icon
* {<OpenLayers.Icon>}. This determines the Icon to be used on the map * {<OpenLayers.Icon>}. This determines the Icon to be used on the map
* for this GeoRSS layer. * for this GeoRSS layer.
*/ */
@ -52,24 +52,24 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
/** /**
* APIProperty: popupSize * APIProperty: popupSize
* {<OpenLayers.Size>} This determines the size of GeoRSS popups. If * {<OpenLayers.Size>} This determines the size of GeoRSS popups. If
* not provided, defaults to 250px by 120px. * not provided, defaults to 250px by 120px.
*/ */
popupSize: null, popupSize: null,
/** /**
* APIProperty: useFeedTitle * APIProperty: useFeedTitle
* {Boolean} Set layer.name to the first <title> element in the feed. Default is true. * {Boolean} Set layer.name to the first <title> element in the feed. Default is true.
*/ */
useFeedTitle: true, useFeedTitle: true,
/** /**
* Constructor: OpenLayers.Layer.GeoRSS * Constructor: OpenLayers.Layer.GeoRSS
* Create a GeoRSS Layer. * Create a GeoRSS Layer.
* *
* Parameters: * Parameters:
* name - {String} * name - {String}
* location - {String} * location - {String}
* options - {Object} * options - {Object}
*/ */
initialize: function(name, location, options) { initialize: function(name, location, options) {
@ -79,7 +79,7 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
}, },
/** /**
* Method: destroy * Method: destroy
*/ */
destroy: function() { destroy: function() {
// Warning: Layer.Markers.destroy() must be called prior to calling // Warning: Layer.Markers.destroy() must be called prior to calling
@ -106,17 +106,17 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
scope: this scope: this
}); });
this.loaded = true; this.loaded = true;
} }
}, },
/** /**
* Method: moveTo * Method: moveTo
* If layer is visible and RSS has not been loaded, load RSS. * If layer is visible and RSS has not been loaded, load RSS.
* *
* Parameters: * Parameters:
* bounds - {Object} * bounds - {Object}
* zoomChanged - {Object} * zoomChanged - {Object}
* minor - {Object} * minor - {Object}
*/ */
moveTo:function(bounds, zoomChanged, minor) { moveTo:function(bounds, zoomChanged, minor) {
OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments);
@ -124,20 +124,20 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
this.loadRSS(); this.loadRSS();
} }
}, },
/** /**
* Method: parseData * Method: parseData
* Parse the data returned from the Events call. * Parse the data returned from the Events call.
* *
* Parameters: * Parameters:
* ajaxRequest - {<OpenLayers.Request.XMLHttpRequest>} * ajaxRequest - {<OpenLayers.Request.XMLHttpRequest>}
*/ */
parseData: function(ajaxRequest) { parseData: function(ajaxRequest) {
var doc = ajaxRequest.responseXML; var doc = ajaxRequest.responseXML;
if (!doc || !doc.documentElement) { if (!doc || !doc.documentElement) {
doc = OpenLayers.Format.XML.prototype.read(ajaxRequest.responseText); doc = OpenLayers.Format.XML.prototype.read(ajaxRequest.responseText);
} }
if (this.useFeedTitle) { if (this.useFeedTitle) {
var name = null; var name = null;
try { try {
@ -148,56 +148,56 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
} }
if (name) { if (name) {
this.setName(name); this.setName(name);
} }
} }
var options = {}; var options = {};
OpenLayers.Util.extend(options, this.formatOptions); OpenLayers.Util.extend(options, this.formatOptions);
if (this.map && !this.projection.equals(this.map.getProjectionObject())) { if (this.map && !this.projection.equals(this.map.getProjectionObject())) {
options.externalProjection = this.projection; options.externalProjection = this.projection;
options.internalProjection = this.map.getProjectionObject(); options.internalProjection = this.map.getProjectionObject();
} }
var format = new OpenLayers.Format.GeoRSS(options); var format = new OpenLayers.Format.GeoRSS(options);
var features = format.read(doc); var features = format.read(doc);
for (var i=0, len=features.length; i<len; i++) { for (var i=0, len=features.length; i<len; i++) {
var data = {}; var data = {};
var feature = features[i]; var feature = features[i];
// we don't support features with no geometry in the GeoRSS // we don't support features with no geometry in the GeoRSS
// layer at this time. // layer at this time.
if (!feature.geometry) { if (!feature.geometry) {
continue; continue;
} }
var title = feature.attributes.title ? var title = feature.attributes.title ?
feature.attributes.title : "Untitled"; feature.attributes.title : "Untitled";
var description = feature.attributes.description ? var description = feature.attributes.description ?
feature.attributes.description : "No description."; feature.attributes.description : "No description.";
var link = feature.attributes.link ? feature.attributes.link : ""; var link = feature.attributes.link ? feature.attributes.link : "";
var location = feature.geometry.getBounds().getCenterLonLat(); var location = feature.geometry.getBounds().getCenterLonLat();
data.icon = this.icon == null ? data.icon = this.icon == null ?
OpenLayers.Marker.defaultIcon() : OpenLayers.Marker.defaultIcon() :
this.icon.clone(); this.icon.clone();
data.popupSize = this.popupSize ? data.popupSize = this.popupSize ?
this.popupSize.clone() : this.popupSize.clone() :
new OpenLayers.Size(250, 120); new OpenLayers.Size(250, 120);
if (title || description) { if (title || description) {
// we have supplemental data, store them. // we have supplemental data, store them.
data.title = title; data.title = title;
data.description = description; data.description = description;
var contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>'; var contentHTML = '<div class="olLayerGeoRSSClose">[x]</div>';
contentHTML += '<div class="olLayerGeoRSSTitle">'; contentHTML += '<div class="olLayerGeoRSSTitle">';
if (link) { if (link) {
contentHTML += '<a class="link" href="'+link+'" target="_blank">'; contentHTML += '<a class="link" href="'+link+'" target="_blank">';
@ -210,7 +210,7 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
contentHTML += '<div style="" class="olLayerGeoRSSDescription">'; contentHTML += '<div style="" class="olLayerGeoRSSDescription">';
contentHTML += description; contentHTML += description;
contentHTML += '</div>'; contentHTML += '</div>';
data['popupContentHTML'] = contentHTML; data['popupContentHTML'] = contentHTML;
} }
var feature = new OpenLayers.Feature(this, location, data); var feature = new OpenLayers.Feature(this, location, data);
this.features.push(feature); this.features.push(feature);
@ -220,12 +220,12 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
} }
this.events.triggerEvent("loadend"); this.events.triggerEvent("loadend");
}, },
/** /**
* Method: markerClick * Method: markerClick
* *
* Parameters: * Parameters:
* evt - {Event} * evt - {Event}
*/ */
markerClick: function(evt) { markerClick: function(evt) {
var sameMarkerClicked = (this == this.layer.selectedFeature); var sameMarkerClicked = (this == this.layer.selectedFeature);
@ -236,13 +236,13 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
if (!sameMarkerClicked) { if (!sameMarkerClicked) {
var popup = this.createPopup(); var popup = this.createPopup();
OpenLayers.Event.observe(popup.div, "click", OpenLayers.Event.observe(popup.div, "click",
OpenLayers.Function.bind(function() { OpenLayers.Function.bind(function() {
for(var i=0, len=this.layer.map.popups.length; i<len; i++) { for(var i=0, len=this.layer.map.popups.length; i<len; i++) {
this.layer.map.removePopup(this.layer.map.popups[i]); this.layer.map.removePopup(this.layer.map.popups[i]);
} }
}, this) }, this)
); );
this.layer.map.addPopup(popup); this.layer.map.addPopup(popup);
} }
OpenLayers.Event.stop(evt); OpenLayers.Event.stop(evt);
}, },
@ -258,8 +258,8 @@ OpenLayers.Layer.GeoRSS = OpenLayers.Class(OpenLayers.Layer.Markers, {
OpenLayers.Util.removeItem(this.features, feature); OpenLayers.Util.removeItem(this.features, feature);
feature.destroy(); feature.destroy();
} }
} }
}, },
CLASS_NAME: "OpenLayers.Layer.GeoRSS" CLASS_NAME: "OpenLayers.Layer.GeoRSS"
}); });

View File

@ -44,26 +44,26 @@
OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, { OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
/** /**
* APIProperty: location * APIProperty: location
* {String} URL of text file. Must be specified in the "options" argument * {String} URL of text file. Must be specified in the "options" argument
* of the constructor. Can not be changed once passed in. * of the constructor. Can not be changed once passed in.
*/ */
location:null, location:null,
/** /**
* Property: features * Property: features
* {Array(<OpenLayers.Feature>)} * {Array(<OpenLayers.Feature>)}
*/ */
features: null, features: null,
/** /**
* APIProperty: formatOptions * APIProperty: formatOptions
* {Object} Hash of options which should be passed to the format when it is * {Object} Hash of options which should be passed to the format when it is
* created. Must be passed in the constructor. * created. Must be passed in the constructor.
*/ */
formatOptions: null, formatOptions: null,
/** /**
* Property: selectedFeature * Property: selectedFeature
* {<OpenLayers.Feature>} * {<OpenLayers.Feature>}
*/ */
@ -72,9 +72,9 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
/** /**
* Constructor: OpenLayers.Layer.Text * Constructor: OpenLayers.Layer.Text
* Create a text layer. * Create a text layer.
* *
* Parameters: * Parameters:
* name - {String} * name - {String}
* options - {Object} Object with properties to be set on the layer. * options - {Object} Object with properties to be set on the layer.
* Must include <location> property. * Must include <location> property.
*/ */
@ -84,7 +84,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
}, },
/** /**
* APIMethod: destroy * APIMethod: destroy
*/ */
destroy: function() { destroy: function() {
// Warning: Layer.Markers.destroy() must be called prior to calling // Warning: Layer.Markers.destroy() must be called prior to calling
@ -96,7 +96,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
this.clearFeatures(); this.clearFeatures();
this.features = null; this.features = null;
}, },
/** /**
* Method: loadText * Method: loadText
* Start the load of the Text data. Don't do this when we first add the layer, * Start the load of the Text data. Don't do this when we first add the layer,
@ -119,17 +119,17 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
}); });
this.loaded = true; this.loaded = true;
} }
} }
}, },
/** /**
* Method: moveTo * Method: moveTo
* If layer is visible and Text has not been loaded, load Text. * If layer is visible and Text has not been loaded, load Text.
* *
* Parameters: * Parameters:
* bounds - {Object} * bounds - {Object}
* zoomChanged - {Object} * zoomChanged - {Object}
* minor - {Object} * minor - {Object}
*/ */
moveTo:function(bounds, zoomChanged, minor) { moveTo:function(bounds, zoomChanged, minor) {
OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments); OpenLayers.Layer.Markers.prototype.moveTo.apply(this, arguments);
@ -137,25 +137,25 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
this.loadText(); this.loadText();
} }
}, },
/** /**
* Method: parseData * Method: parseData
* *
* Parameters: * Parameters:
* ajaxRequest - {<OpenLayers.Request.XMLHttpRequest>} * ajaxRequest - {<OpenLayers.Request.XMLHttpRequest>}
*/ */
parseData: function(ajaxRequest) { parseData: function(ajaxRequest) {
var text = ajaxRequest.responseText; var text = ajaxRequest.responseText;
var options = {}; var options = {};
OpenLayers.Util.extend(options, this.formatOptions); OpenLayers.Util.extend(options, this.formatOptions);
if (this.map && !this.projection.equals(this.map.getProjectionObject())) { if (this.map && !this.projection.equals(this.map.getProjectionObject())) {
options.externalProjection = this.projection; options.externalProjection = this.projection;
options.internalProjection = this.map.getProjectionObject(); options.internalProjection = this.map.getProjectionObject();
} }
var parser = new OpenLayers.Format.Text(options); var parser = new OpenLayers.Format.Text(options);
var features = parser.read(text); var features = parser.read(text);
for (var i=0, len=features.length; i<len; i++) { for (var i=0, len=features.length; i<len; i++) {
@ -163,18 +163,18 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
var feature = features[i]; var feature = features[i];
var location; var location;
var iconSize, iconOffset; var iconSize, iconOffset;
location = new OpenLayers.LonLat(feature.geometry.x, location = new OpenLayers.LonLat(feature.geometry.x,
feature.geometry.y); feature.geometry.y);
if (feature.style.graphicWidth if (feature.style.graphicWidth
&& feature.style.graphicHeight) { && feature.style.graphicHeight) {
iconSize = new OpenLayers.Size( iconSize = new OpenLayers.Size(
feature.style.graphicWidth, feature.style.graphicWidth,
feature.style.graphicHeight); feature.style.graphicHeight);
} }
// FIXME: At the moment, we only use this if we have an // FIXME: At the moment, we only use this if we have an
// externalGraphic, because icon has no setOffset API Method. // externalGraphic, because icon has no setOffset API Method.
/** /**
* FIXME FIRST!! * FIXME FIRST!!
@ -189,38 +189,38 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
if (feature.style.graphicXOffset !== undefined if (feature.style.graphicXOffset !== undefined
&& feature.style.graphicYOffset !== undefined) { && feature.style.graphicYOffset !== undefined) {
iconOffset = new OpenLayers.Pixel( iconOffset = new OpenLayers.Pixel(
feature.style.graphicXOffset, feature.style.graphicXOffset,
feature.style.graphicYOffset); feature.style.graphicYOffset);
} }
if (feature.style.externalGraphic != null) { if (feature.style.externalGraphic != null) {
data.icon = new OpenLayers.Icon(feature.style.externalGraphic, data.icon = new OpenLayers.Icon(feature.style.externalGraphic,
iconSize, iconSize,
iconOffset); iconOffset);
} else { } else {
data.icon = OpenLayers.Marker.defaultIcon(); data.icon = OpenLayers.Marker.defaultIcon();
//allows for the case where the image url is not //allows for the case where the image url is not
// specified but the size is. use a default icon // specified but the size is. use a default icon
// but change the size // but change the size
if (iconSize != null) { if (iconSize != null) {
data.icon.setSize(iconSize); data.icon.setSize(iconSize);
} }
} }
if ((feature.attributes.title != null) if ((feature.attributes.title != null)
&& (feature.attributes.description != null)) { && (feature.attributes.description != null)) {
data['popupContentHTML'] = data['popupContentHTML'] =
'<h2>'+feature.attributes.title+'</h2>' + '<h2>'+feature.attributes.title+'</h2>' +
'<p>'+feature.attributes.description+'</p>'; '<p>'+feature.attributes.description+'</p>';
} }
data['overflow'] = feature.attributes.overflow || "auto"; data['overflow'] = feature.attributes.overflow || "auto";
var markerFeature = new OpenLayers.Feature(this, location, data); var markerFeature = new OpenLayers.Feature(this, location, data);
this.features.push(markerFeature); this.features.push(markerFeature);
var marker = markerFeature.createMarker(); var marker = markerFeature.createMarker();
if ((feature.attributes.title != null) if ((feature.attributes.title != null)
&& (feature.attributes.description != null)) { && (feature.attributes.description != null)) {
marker.events.register('click', markerFeature, this.markerClick); marker.events.register('click', markerFeature, this.markerClick);
} }
@ -228,12 +228,12 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
} }
this.events.triggerEvent("loadend"); this.events.triggerEvent("loadend");
}, },
/** /**
* Property: markerClick * Property: markerClick
* *
* Parameters: * Parameters:
* evt - {Event} * evt - {Event}
* *
* Context: * Context:
* - {<OpenLayers.Feature>} * - {<OpenLayers.Feature>}
@ -245,7 +245,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
this.layer.map.removePopup(this.layer.map.popups[i]); this.layer.map.removePopup(this.layer.map.popups[i]);
} }
if (!sameMarkerClicked) { if (!sameMarkerClicked) {
this.layer.map.addPopup(this.createPopup()); this.layer.map.addPopup(this.createPopup());
} }
OpenLayers.Event.stop(evt); OpenLayers.Event.stop(evt);
}, },
@ -260,7 +260,7 @@ OpenLayers.Layer.Text = OpenLayers.Class(OpenLayers.Layer.Markers, {
OpenLayers.Util.removeItem(this.features, feature); OpenLayers.Util.removeItem(this.features, feature);
feature.destroy(); feature.destroy();
} }
} }
}, },
CLASS_NAME: "OpenLayers.Layer.Text" CLASS_NAME: "OpenLayers.Layer.Text"

View File

@ -8,26 +8,26 @@
*/ */
/** /**
* Class: OpenLayers.Renderer.Canvas * Class: OpenLayers.Renderer.Canvas
* A renderer based on the 2D 'canvas' drawing element. * A renderer based on the 2D 'canvas' drawing element.
* *
* Inherits: * Inherits:
* - <OpenLayers.Renderer> * - <OpenLayers.Renderer>
*/ */
OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, { OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* APIProperty: hitDetection * APIProperty: hitDetection
* {Boolean} Allow for hit detection of features. Default is true. * {Boolean} Allow for hit detection of features. Default is true.
*/ */
hitDetection: true, hitDetection: true,
/** /**
* Property: hitOverflow * Property: hitOverflow
* {Number} The method for converting feature identifiers to color values * {Number} The method for converting feature identifiers to color values
* supports 16777215 sequential values. Two features cannot be * supports 16777215 sequential values. Two features cannot be
* predictably detected if their identifiers differ by more than this * predictably detected if their identifiers differ by more than this
* value. The hitOverflow allows for bigger numbers (but the * value. The hitOverflow allows for bigger numbers (but the
* difference in values is still limited). * difference in values is still limited).
*/ */
hitOverflow: 0, hitOverflow: 0,
@ -36,27 +36,27 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
* Property: canvas * Property: canvas
* {Canvas} The canvas context object. * {Canvas} The canvas context object.
*/ */
canvas: null, canvas: null,
/** /**
* Property: features * Property: features
* {Object} Internal object of feature/style pairs for use in redrawing the layer. * {Object} Internal object of feature/style pairs for use in redrawing the layer.
*/ */
features: null, features: null,
/** /**
* Property: pendingRedraw * Property: pendingRedraw
* {Boolean} The renderer needs a redraw call to render features added while * {Boolean} The renderer needs a redraw call to render features added while
* the renderer was locked. * the renderer was locked.
*/ */
pendingRedraw: false, pendingRedraw: false,
/** /**
* Property: cachedSymbolBounds * Property: cachedSymbolBounds
* {Object} Internal cache of calculated symbol extents. * {Object} Internal cache of calculated symbol extents.
*/ */
cachedSymbolBounds: {}, cachedSymbolBounds: {},
/** /**
* Constructor: OpenLayers.Renderer.Canvas * Constructor: OpenLayers.Renderer.Canvas
* *
@ -75,7 +75,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
this.hitContext = this.hitCanvas.getContext("2d"); this.hitContext = this.hitCanvas.getContext("2d");
} }
}, },
/** /**
* Method: setExtent * Method: setExtent
* Set the visible part of the layer. * Set the visible part of the layer.
@ -94,13 +94,13 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
// always redraw features // always redraw features
return false; return false;
}, },
/** /**
* Method: eraseGeometry * Method: eraseGeometry
* Erase a geometry from the renderer. Because the Canvas renderer has * Erase a geometry from the renderer. Because the Canvas renderer has
* 'memory' of the features that it has drawn, we have to remove the * 'memory' of the features that it has drawn, we have to remove the
* feature so it doesn't redraw. * feature so it doesn't redraw.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* featureId - {String} * featureId - {String}
@ -111,14 +111,14 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* APIMethod: supported * APIMethod: supported
* *
* Returns: * Returns:
* {Boolean} Whether or not the browser supports the renderer class * {Boolean} Whether or not the browser supports the renderer class
*/ */
supported: function() { supported: function() {
return OpenLayers.CANVAS_SUPPORTED; return OpenLayers.CANVAS_SUPPORTED;
}, },
/** /**
* Method: setSize * Method: setSize
* Sets the size of the drawing surface. * Sets the size of the drawing surface.
@ -126,7 +126,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
* Once the size is updated, redraw the canvas. * Once the size is updated, redraw the canvas.
* *
* Parameters: * Parameters:
* size - {<OpenLayers.Size>} * size - {<OpenLayers.Size>}
*/ */
setSize: function(size) { setSize: function(size) {
this.size = size.clone(); this.size = size.clone();
@ -144,15 +144,15 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
hitCanvas.height = size.h; hitCanvas.height = size.h;
} }
}, },
/** /**
* Method: drawFeature * Method: drawFeature
* Draw the feature. Stores the feature in the features list, * Draw the feature. Stores the feature in the features list,
* then redraws the layer. * then redraws the layer.
* *
* Parameters: * Parameters:
* feature - {<OpenLayers.Feature.Vector>} * feature - {<OpenLayers.Feature.Vector>}
* style - {<Object>} * style - {<Object>}
* *
* Returns: * Returns:
* {Boolean} The feature has been drawn completely. If the feature has no * {Boolean} The feature has been drawn completely. If the feature has no
@ -191,14 +191,14 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
return rendered; return rendered;
}, },
/** /**
* Method: drawGeometry * Method: drawGeometry
* Used when looping (in redraw) over the features; draws * Used when looping (in redraw) over the features; draws
* the canvas. * the canvas.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
*/ */
drawGeometry: function(geometry, style, featureId) { drawGeometry: function(geometry, style, featureId) {
var className = geometry.CLASS_NAME; var className = geometry.CLASS_NAME;
@ -231,19 +231,19 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* Method: drawExternalGraphic * Method: drawExternalGraphic
* Called to draw External graphics. * Called to draw External graphics.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
* featureId - {String} * featureId - {String}
*/ */
drawExternalGraphic: function(geometry, style, featureId) { drawExternalGraphic: function(geometry, style, featureId) {
var img = new Image(); var img = new Image();
var title = style.title || style.graphicTitle; var title = style.title || style.graphicTitle;
if (title) { if (title) {
img.title = title; img.title = title;
} }
var width = style.graphicWidth || style.graphicHeight; var width = style.graphicWidth || style.graphicHeight;
@ -256,7 +256,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
style.graphicYOffset : -(0.5 * height); style.graphicYOffset : -(0.5 * height);
var opacity = style.graphicOpacity || style.fillOpacity; var opacity = style.graphicOpacity || style.fillOpacity;
var onLoad = function() { var onLoad = function() {
if(!this.features[featureId]) { if(!this.features[featureId]) {
return; return;
@ -292,42 +292,42 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* Method: drawNamedSymbol * Method: drawNamedSymbol
* Called to draw Well Known Graphic Symbol Name. * Called to draw Well Known Graphic Symbol Name.
* This method is only called by the renderer itself. * This method is only called by the renderer itself.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
* featureId - {String} * featureId - {String}
*/ */
drawNamedSymbol: function(geometry, style, featureId) { drawNamedSymbol: function(geometry, style, featureId) {
var x, y, cx, cy, i, symbolBounds, scaling, angle; var x, y, cx, cy, i, symbolBounds, scaling, angle;
var unscaledStrokeWidth; var unscaledStrokeWidth;
var deg2rad = Math.PI / 180.0; var deg2rad = Math.PI / 180.0;
var symbol = OpenLayers.Renderer.symbol[style.graphicName]; var symbol = OpenLayers.Renderer.symbol[style.graphicName];
if (!symbol) { if (!symbol) {
throw new Error(style.graphicName + ' is not a valid symbol name'); throw new Error(style.graphicName + ' is not a valid symbol name');
} }
if (!symbol.length || symbol.length < 2) return; if (!symbol.length || symbol.length < 2) return;
var pt = this.getLocalXY(geometry); var pt = this.getLocalXY(geometry);
var p0 = pt[0]; var p0 = pt[0];
var p1 = pt[1]; var p1 = pt[1];
if (isNaN(p0) || isNaN(p1)) return; if (isNaN(p0) || isNaN(p1)) return;
// Use rounded line caps // Use rounded line caps
this.canvas.lineCap = "round"; this.canvas.lineCap = "round";
this.canvas.lineJoin = "round"; this.canvas.lineJoin = "round";
if (this.hitDetection) { if (this.hitDetection) {
this.hitContext.lineCap = "round"; this.hitContext.lineCap = "round";
this.hitContext.lineJoin = "round"; this.hitContext.lineJoin = "round";
} }
// Scale and rotate symbols, using precalculated bounds whenever possible. // Scale and rotate symbols, using precalculated bounds whenever possible.
if (style.graphicName in this.cachedSymbolBounds) { if (style.graphicName in this.cachedSymbolBounds) {
symbolBounds = this.cachedSymbolBounds[style.graphicName]; symbolBounds = this.cachedSymbolBounds[style.graphicName];
@ -338,39 +338,39 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
this.cachedSymbolBounds[style.graphicName] = symbolBounds; this.cachedSymbolBounds[style.graphicName] = symbolBounds;
} }
// Push symbol scaling, translation and rotation onto the transformation stack in reverse order. // Push symbol scaling, translation and rotation onto the transformation stack in reverse order.
// Don't forget to apply all canvas transformations to the hitContext canvas as well(!) // Don't forget to apply all canvas transformations to the hitContext canvas as well(!)
this.canvas.save(); this.canvas.save();
if (this.hitDetection) { this.hitContext.save(); } if (this.hitDetection) { this.hitContext.save(); }
// Step 3: place symbol at the desired location // Step 3: place symbol at the desired location
this.canvas.translate(p0,p1); this.canvas.translate(p0,p1);
if (this.hitDetection) { this.hitContext.translate(p0,p1); } if (this.hitDetection) { this.hitContext.translate(p0,p1); }
// Step 2a. rotate the symbol if necessary // Step 2a. rotate the symbol if necessary
angle = deg2rad * style.rotation; // will be NaN when style.rotation is undefined. angle = deg2rad * style.rotation; // will be NaN when style.rotation is undefined.
if (!isNaN(angle)) { if (!isNaN(angle)) {
this.canvas.rotate(angle); this.canvas.rotate(angle);
if (this.hitDetection) { this.hitContext.rotate(angle); } if (this.hitDetection) { this.hitContext.rotate(angle); }
} }
// // Step 2: scale symbol such that pointRadius equals half the maximum symbol dimension. // // Step 2: scale symbol such that pointRadius equals half the maximum symbol dimension.
scaling = 2.0 * style.pointRadius / Math.max(symbolBounds.getWidth(), symbolBounds.getHeight()); scaling = 2.0 * style.pointRadius / Math.max(symbolBounds.getWidth(), symbolBounds.getHeight());
this.canvas.scale(scaling,scaling); this.canvas.scale(scaling,scaling);
if (this.hitDetection) { this.hitContext.scale(scaling,scaling); } if (this.hitDetection) { this.hitContext.scale(scaling,scaling); }
// Step 1: center the symbol at the origin // Step 1: center the symbol at the origin
cx = symbolBounds.getCenterLonLat().lon; cx = symbolBounds.getCenterLonLat().lon;
cy = symbolBounds.getCenterLonLat().lat; cy = symbolBounds.getCenterLonLat().lat;
this.canvas.translate(-cx,-cy); this.canvas.translate(-cx,-cy);
if (this.hitDetection) { this.hitContext.translate(-cx,-cy); } if (this.hitDetection) { this.hitContext.translate(-cx,-cy); }
// Don't forget to scale stroke widths, because they are affected by canvas scale transformations as well(!) // Don't forget to scale stroke widths, because they are affected by canvas scale transformations as well(!)
// Alternative: scale symbol coordinates manually, so stroke width scaling is not needed anymore. // Alternative: scale symbol coordinates manually, so stroke width scaling is not needed anymore.
unscaledStrokeWidth = style.strokeWidth; unscaledStrokeWidth = style.strokeWidth;
style.strokeWidth = unscaledStrokeWidth / scaling; style.strokeWidth = unscaledStrokeWidth / scaling;
if (style.fill !== false) { if (style.fill !== false) {
this.setCanvasStyle("fill", style); this.setCanvasStyle("fill", style);
this.canvas.beginPath(); this.canvas.beginPath();
@ -395,8 +395,8 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
this.hitContext.closePath(); this.hitContext.closePath();
this.hitContext.fill(); this.hitContext.fill();
} }
} }
if (style.stroke !== false) { if (style.stroke !== false) {
this.setCanvasStyle("stroke", style); this.setCanvasStyle("stroke", style);
this.canvas.beginPath(); this.canvas.beginPath();
@ -408,8 +408,8 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
this.canvas.closePath(); this.canvas.closePath();
this.canvas.stroke(); this.canvas.stroke();
if (this.hitDetection) { if (this.hitDetection) {
this.setHitContextStyle("stroke", featureId, style, scaling); this.setHitContextStyle("stroke", featureId, style, scaling);
this.hitContext.beginPath(); this.hitContext.beginPath();
@ -422,13 +422,13 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
this.hitContext.closePath(); this.hitContext.closePath();
this.hitContext.stroke(); this.hitContext.stroke();
} }
} }
style.strokeWidth = unscaledStrokeWidth; style.strokeWidth = unscaledStrokeWidth;
this.canvas.restore(); this.canvas.restore();
if (this.hitDetection) { this.hitContext.restore(); } if (this.hitDetection) { this.hitContext.restore(); }
this.setCanvasStyle("reset"); this.setCanvasStyle("reset");
}, },
/** /**
@ -440,10 +440,10 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
* style - {Object} Symbolizer hash * style - {Object} Symbolizer hash
*/ */
setCanvasStyle: function(type, style) { setCanvasStyle: function(type, style) {
if (type === "fill") { if (type === "fill") {
this.canvas.globalAlpha = style['fillOpacity']; this.canvas.globalAlpha = style['fillOpacity'];
this.canvas.fillStyle = style['fillColor']; this.canvas.fillStyle = style['fillColor'];
} else if (type === "stroke") { } else if (type === "stroke") {
this.canvas.globalAlpha = style['strokeOpacity']; this.canvas.globalAlpha = style['strokeOpacity'];
this.canvas.strokeStyle = style['strokeColor']; this.canvas.strokeStyle = style['strokeColor'];
this.canvas.lineWidth = style['strokeWidth']; this.canvas.lineWidth = style['strokeWidth'];
@ -452,7 +452,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
this.canvas.lineWidth = 1; this.canvas.lineWidth = 1;
} }
}, },
/** /**
* Method: featureIdToHex * Method: featureIdToHex
* Convert a feature ID string into an RGB hex string. * Convert a feature ID string into an RGB hex string.
@ -474,7 +474,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
hex = "#" + hex.substring(len-6, len); hex = "#" + hex.substring(len-6, len);
return hex; return hex;
}, },
/** /**
* Method: setHitContextStyle * Method: setHitContextStyle
* Prepare the hit canvas for drawing by setting various global settings. * Prepare the hit canvas for drawing by setting various global settings.
@ -489,10 +489,10 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
if (type == "fill") { if (type == "fill") {
this.hitContext.globalAlpha = 1.0; this.hitContext.globalAlpha = 1.0;
this.hitContext.fillStyle = hex; this.hitContext.fillStyle = hex;
} else if (type == "stroke") { } else if (type == "stroke") {
this.hitContext.globalAlpha = 1.0; this.hitContext.globalAlpha = 1.0;
this.hitContext.strokeStyle = hex; this.hitContext.strokeStyle = hex;
// bump up stroke width to deal with antialiasing. If strokeScaling is defined, we're rendering a symbol // bump up stroke width to deal with antialiasing. If strokeScaling is defined, we're rendering a symbol
// on a transformed canvas, so the antialias width bump has to scale as well. // on a transformed canvas, so the antialias width bump has to scale as well.
if (typeof strokeScaling === "undefined") { if (typeof strokeScaling === "undefined") {
this.hitContext.lineWidth = symbolizer.strokeWidth + 2; this.hitContext.lineWidth = symbolizer.strokeWidth + 2;
@ -508,12 +508,12 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* Method: drawPoint * Method: drawPoint
* This method is only called by the renderer itself. * This method is only called by the renderer itself.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
* featureId - {String} * featureId - {String}
*/ */
drawPoint: function(geometry, style, featureId) { drawPoint: function(geometry, style, featureId) {
if(style.graphic !== false) { if(style.graphic !== false) {
if(style.externalGraphic) { if(style.externalGraphic) {
@ -557,30 +557,30 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
} }
}, },
/** /**
* Method: drawLineString * Method: drawLineString
* This method is only called by the renderer itself. * This method is only called by the renderer itself.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
* featureId - {String} * featureId - {String}
*/ */
drawLineString: function(geometry, style, featureId) { drawLineString: function(geometry, style, featureId) {
style = OpenLayers.Util.applyDefaults({fill: false}, style); style = OpenLayers.Util.applyDefaults({fill: false}, style);
this.drawLinearRing(geometry, style, featureId); this.drawLinearRing(geometry, style, featureId);
}, },
/** /**
* Method: drawLinearRing * Method: drawLinearRing
* This method is only called by the renderer itself. * This method is only called by the renderer itself.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
* featureId - {String} * featureId - {String}
*/ */
drawLinearRing: function(geometry, style, featureId) { drawLinearRing: function(geometry, style, featureId) {
if (style.fill !== false) { if (style.fill !== false) {
this.setCanvasStyle("fill", style); this.setCanvasStyle("fill", style);
@ -600,7 +600,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
this.setCanvasStyle("reset"); this.setCanvasStyle("reset");
}, },
/** /**
* Method: renderPath * Method: renderPath
* Render a path with stroke and optional fill. * Render a path with stroke and optional fill.
@ -625,36 +625,36 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
} }
}, },
/** /**
* Method: drawPolygon * Method: drawPolygon
* This method is only called by the renderer itself. * This method is only called by the renderer itself.
* *
* Parameters: * Parameters:
* geometry - {<OpenLayers.Geometry>} * geometry - {<OpenLayers.Geometry>}
* style - {Object} * style - {Object}
* featureId - {String} * featureId - {String}
*/ */
drawPolygon: function(geometry, style, featureId) { drawPolygon: function(geometry, style, featureId) {
var components = geometry.components; var components = geometry.components;
var len = components.length; var len = components.length;
this.drawLinearRing(components[0], style, featureId); this.drawLinearRing(components[0], style, featureId);
// erase inner rings // erase inner rings
for (var i=1; i<len; ++i) { for (var i=1; i<len; ++i) {
/** /**
* Note that this is overly agressive. Here we punch holes through * Note that this is overly agressive. Here we punch holes through
* all previously rendered features on the same canvas. A better * all previously rendered features on the same canvas. A better
* solution for polygons with interior rings would be to draw the * solution for polygons with interior rings would be to draw the
* polygon on a sketch canvas first. We could erase all holes * polygon on a sketch canvas first. We could erase all holes
* there and then copy the drawing to the layer canvas. * there and then copy the drawing to the layer canvas.
* TODO: http://trac.osgeo.org/openlayers/ticket/3130 * TODO: http://trac.osgeo.org/openlayers/ticket/3130
*/ */
this.canvas.globalCompositeOperation = "destination-out"; this.canvas.globalCompositeOperation = "destination-out";
if (this.hitDetection) { if (this.hitDetection) {
this.hitContext.globalCompositeOperation = "destination-out"; this.hitContext.globalCompositeOperation = "destination-out";
} }
this.drawLinearRing( this.drawLinearRing(
components[i], components[i],
OpenLayers.Util.applyDefaults({stroke: false, fillOpacity: 1.0}, style), OpenLayers.Util.applyDefaults({stroke: false, fillOpacity: 1.0}, style),
featureId featureId
); );
@ -663,13 +663,13 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
this.hitContext.globalCompositeOperation = "source-over"; this.hitContext.globalCompositeOperation = "source-over";
} }
this.drawLinearRing( this.drawLinearRing(
components[i], components[i],
OpenLayers.Util.applyDefaults({fill: false}, style), OpenLayers.Util.applyDefaults({fill: false}, style),
featureId featureId
); );
} }
}, },
/** /**
* Method: drawText * Method: drawText
* This method is only called by the renderer itself. * This method is only called by the renderer itself.
@ -746,12 +746,12 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
this.setCanvasStyle("reset"); this.setCanvasStyle("reset");
}, },
/** /**
* Method: getLocalXY * Method: getLocalXY
* transform geographic xy into pixel xy * transform geographic xy into pixel xy
* *
* Parameters: * Parameters:
* point - {<OpenLayers.Geometry.Point>} * point - {<OpenLayers.Geometry.Point>}
*/ */
getLocalXY: function(point) { getLocalXY: function(point) {
@ -765,7 +765,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* Method: clear * Method: clear
* Clear all vectors from the renderer. * Clear all vectors from the renderer.
*/ */
clear: function() { clear: function() {
var height = this.root.height; var height = this.root.height;
var width = this.root.width; var width = this.root.width;
@ -778,19 +778,19 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
/** /**
* Method: getFeatureIdFromEvent * Method: getFeatureIdFromEvent
* Returns a feature id from an event on the renderer. * Returns a feature id from an event on the renderer.
* *
* Parameters: * Parameters:
* evt - {<OpenLayers.Event>} * evt - {<OpenLayers.Event>}
* *
* Returns: * Returns:
* {<OpenLayers.Feature.Vector} A feature or undefined. This method returns a * {<OpenLayers.Feature.Vector} A feature or undefined. This method returns a
* feature instead of a feature id to avoid an unnecessary lookup on the * feature instead of a feature id to avoid an unnecessary lookup on the
* layer. * layer.
*/ */
getFeatureIdFromEvent: function(evt) { getFeatureIdFromEvent: function(evt) {
var featureId, feature; var featureId, feature;
if (this.hitDetection && this.root.style.display !== "none") { if (this.hitDetection && this.root.style.display !== "none") {
// this dragging check should go in the feature handler // this dragging check should go in the feature handler
if (!this.map.dragging) { if (!this.map.dragging) {
@ -815,14 +815,14 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
} }
return feature; return feature;
}, },
/** /**
* Method: eraseFeatures * Method: eraseFeatures
* This is called by the layer to erase features; removes the feature from * This is called by the layer to erase features; removes the feature from
* the list, then redraws the layer. * the list, then redraws the layer.
* *
* Parameters: * Parameters:
* features - {Array(<OpenLayers.Feature.Vector>)} * features - {Array(<OpenLayers.Feature.Vector>)}
*/ */
eraseFeatures: function(features) { eraseFeatures: function(features) {
if(!(OpenLayers.Util.isArray(features))) { if(!(OpenLayers.Util.isArray(features))) {
@ -869,7 +869,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
item = labelMap[i]; item = labelMap[i];
this.drawText(item[0].geometry.getCentroid(), item[1]); this.drawText(item[0].geometry.getCentroid(), item[1]);
} }
} }
}, },
CLASS_NAME: "OpenLayers.Renderer.Canvas" CLASS_NAME: "OpenLayers.Renderer.Canvas"

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

2032
mermaid/mermaid.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -29741,7 +29741,7 @@ const StandardEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", ""
exports.StandardEncoding = StandardEncoding; exports.StandardEncoding = StandardEncoding;
const WinAnsiEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"]; const WinAnsiEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"];
exports.WinAnsiEncoding = WinAnsiEncoding; exports.WinAnsiEncoding = WinAnsiEncoding;
const SymbolSetEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""]; const SymbolSetEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefor", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""];
exports.SymbolSetEncoding = SymbolSetEncoding; exports.SymbolSetEncoding = SymbolSetEncoding;
const ZapfDingbatsEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""]; const ZapfDingbatsEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""];
exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding;

View File

@ -18429,7 +18429,7 @@ public static $encmap = [
'koi8-u' => [0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'SF100000',129=>'SF110000',130=>'SF010000',131=>'SF030000',132=>'SF020000',133=>'SF040000',134=>'SF080000',135=>'SF090000',136=>'SF060000',137=>'SF070000',138=>'SF050000',139=>'upblock',140=>'dnblock',141=>'block',142=>'lfblock',143=>'rtblock',144=>'ltshade',145=>'shade',146=>'dkshade',147=>'integraltp',148=>'filledbox',149=>'bullet',150=>'radical',151=>'approxequal',152=>'lessequal',153=>'greaterequal',154=>'space',155=>'integralbt',156=>'degree',157=>'twosuperior',158=>'periodcentered',159=>'divide',160=>'SF430000',161=>'SF240000',162=>'SF510000',163=>'afii10071',164=>'afii10101',165=>'SF390000',166=>'afii10103',167=>'afii10104',168=>'SF250000',169=>'SF500000',170=>'SF490000',171=>'SF380000',172=>'SF280000',173=>'afii10098',174=>'SF260000',175=>'SF360000',176=>'SF370000',177=>'SF420000',178=>'SF190000',179=>'afii10023',180=>'afii10053',181=>'SF230000',182=>'afii10055',183=>'afii10056',184=>'SF410000',185=>'SF450000',186=>'SF460000',187=>'SF400000',188=>'SF540000',189=>'afii10050',190=>'SF440000',191=>'copyright',192=>'afii10096',193=>'afii10065',194=>'afii10066',195=>'afii10088',196=>'afii10069',197=>'afii10070',198=>'afii10086',199=>'afii10068',200=>'afii10087',201=>'afii10074',202=>'afii10075',203=>'afii10076',204=>'afii10077',205=>'afii10078',206=>'afii10079',207=>'afii10080',208=>'afii10081',209=>'afii10097',210=>'afii10082',211=>'afii10083',212=>'afii10084',213=>'afii10085',214=>'afii10072',215=>'afii10067',216=>'afii10094',217=>'afii10093',218=>'afii10073',219=>'afii10090',220=>'afii10095',221=>'afii10091',222=>'afii10089',223=>'afii10092',224=>'afii10048',225=>'afii10017',226=>'afii10018',227=>'afii10040',228=>'afii10021',229=>'afii10022',230=>'afii10038',231=>'afii10020',232=>'afii10039',233=>'afii10026',234=>'afii10027',235=>'afii10028',236=>'afii10029',237=>'afii10030',238=>'afii10031',239=>'afii10032',240=>'afii10033',241=>'afii10049',242=>'afii10034',243=>'afii10035',244=>'afii10036',245=>'afii10037',246=>'afii10024',247=>'afii10019',248=>'afii10046',249=>'afii10045',250=>'afii10025',251=>'afii10042',252=>'afii10047',253=>'afii10043',254=>'afii10041',255=>'afii10044'], 'koi8-u' => [0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'SF100000',129=>'SF110000',130=>'SF010000',131=>'SF030000',132=>'SF020000',133=>'SF040000',134=>'SF080000',135=>'SF090000',136=>'SF060000',137=>'SF070000',138=>'SF050000',139=>'upblock',140=>'dnblock',141=>'block',142=>'lfblock',143=>'rtblock',144=>'ltshade',145=>'shade',146=>'dkshade',147=>'integraltp',148=>'filledbox',149=>'bullet',150=>'radical',151=>'approxequal',152=>'lessequal',153=>'greaterequal',154=>'space',155=>'integralbt',156=>'degree',157=>'twosuperior',158=>'periodcentered',159=>'divide',160=>'SF430000',161=>'SF240000',162=>'SF510000',163=>'afii10071',164=>'afii10101',165=>'SF390000',166=>'afii10103',167=>'afii10104',168=>'SF250000',169=>'SF500000',170=>'SF490000',171=>'SF380000',172=>'SF280000',173=>'afii10098',174=>'SF260000',175=>'SF360000',176=>'SF370000',177=>'SF420000',178=>'SF190000',179=>'afii10023',180=>'afii10053',181=>'SF230000',182=>'afii10055',183=>'afii10056',184=>'SF410000',185=>'SF450000',186=>'SF460000',187=>'SF400000',188=>'SF540000',189=>'afii10050',190=>'SF440000',191=>'copyright',192=>'afii10096',193=>'afii10065',194=>'afii10066',195=>'afii10088',196=>'afii10069',197=>'afii10070',198=>'afii10086',199=>'afii10068',200=>'afii10087',201=>'afii10074',202=>'afii10075',203=>'afii10076',204=>'afii10077',205=>'afii10078',206=>'afii10079',207=>'afii10080',208=>'afii10081',209=>'afii10097',210=>'afii10082',211=>'afii10083',212=>'afii10084',213=>'afii10085',214=>'afii10072',215=>'afii10067',216=>'afii10094',217=>'afii10093',218=>'afii10073',219=>'afii10090',220=>'afii10095',221=>'afii10091',222=>'afii10089',223=>'afii10092',224=>'afii10048',225=>'afii10017',226=>'afii10018',227=>'afii10040',228=>'afii10021',229=>'afii10022',230=>'afii10038',231=>'afii10020',232=>'afii10039',233=>'afii10026',234=>'afii10027',235=>'afii10028',236=>'afii10029',237=>'afii10030',238=>'afii10031',239=>'afii10032',240=>'afii10033',241=>'afii10049',242=>'afii10034',243=>'afii10035',244=>'afii10036',245=>'afii10037',246=>'afii10024',247=>'afii10019',248=>'afii10046',249=>'afii10045',250=>'afii10025',251=>'afii10042',252=>'afii10047',253=>'afii10043',254=>'afii10041',255=>'afii10044'],
// encoding map for: symbol // encoding map for: symbol
'symbol' => [0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'universal',35=>'numbersign',36=>'existential',37=>'percent',38=>'ampersand',39=>'suchthat',40=>'parenleft',41=>'parenright',42=>'asteriskmath',43=>'plus',44=>'comma',45=>'minus',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'congruent',65=>'Alpha',66=>'Beta',67=>'Chi',68=>'Delta',69=>'Epsilon',70=>'Phi',71=>'Gamma',72=>'Eta',73=>'Iota',74=>'theta1',75=>'Kappa',76=>'Lambda',77=>'Mu',78=>'Nu',79=>'Omicron',80=>'Pi',81=>'Theta',82=>'Rho',83=>'Sigma',84=>'Tau',85=>'Upsilon',86=>'sigma1',87=>'Omega',88=>'Xi',89=>'Psi',90=>'Zeta',91=>'bracketleft',92=>'therefore',93=>'bracketright',94=>'perpendicular',95=>'underscore',96=>'radicalex',97=>'alpha',98=>'beta',99=>'chi',100=>'delta',101=>'epsilon',102=>'phi',103=>'gamma',104=>'eta',105=>'iota',106=>'phi1',107=>'kappa',108=>'lambda',109=>'mu',110=>'nu',111=>'omicron',112=>'pi',113=>'theta',114=>'rho',115=>'sigma',116=>'tau',117=>'upsilon',118=>'omega1',119=>'omega',120=>'xi',121=>'psi',122=>'zeta',123=>'braceleft',124=>'bar',125=>'braceright',126=>'similar',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'Euro',161=>'Upsilon1',162=>'minute',163=>'lessequal',164=>'fraction',165=>'infinity',166=>'florin',167=>'club',168=>'diamond',169=>'heart',170=>'spade',171=>'arrowboth',172=>'arrowleft',173=>'arrowup',174=>'arrowright',175=>'arrowdown',176=>'degree',177=>'plusminus',178=>'second',179=>'greaterequal',180=>'multiply',181=>'proportional',182=>'partialdiff',183=>'bullet',184=>'divide',185=>'notequal',186=>'equivalence',187=>'approxequal',188=>'ellipsis',189=>'arrowvertex',190=>'arrowhorizex',191=>'carriagereturn',192=>'aleph',193=>'Ifraktur',194=>'Rfraktur',195=>'weierstrass',196=>'circlemultiply',197=>'circleplus',198=>'emptyset',199=>'intersection',200=>'union',201=>'propersuperset',202=>'reflexsuperset',203=>'notsubset',204=>'propersubset',205=>'reflexsubset',206=>'element',207=>'notelement',208=>'angle',209=>'gradient',210=>'registerserif',211=>'copyrightserif',212=>'trademarkserif',213=>'product',214=>'radical',215=>'dotmath',216=>'logicalnot',217=>'logicaland',218=>'logicalor',219=>'arrowdblboth',220=>'arrowdblleft',221=>'arrowdblup',222=>'arrowdblright',223=>'arrowdbldown',224=>'lozenge',225=>'angleleft',226=>'registersans',227=>'copyrightsans',228=>'trademarksans',229=>'summation',230=>'parenlefttp',231=>'parenleftex',232=>'parenleftbt',233=>'bracketlefttp',234=>'bracketleftex',235=>'bracketleftbt',236=>'bracelefttp',237=>'braceleftmid',238=>'braceleftbt',239=>'braceex',240=>'.notdef',241=>'angleright',242=>'integral',243=>'integraltp',244=>'integralex',245=>'integralbt',246=>'parenrighttp',247=>'parenrightex',248=>'parenrightbt',249=>'bracketrighttp',250=>'bracketrightex',251=>'bracketrightbt',252=>'bracerighttp',253=>'bracerightmid',254=>'bracerightbt',255=>'.notdef',1226=>'registered',1227=>'copyright',1228=>'trademark'], 'symbol' => [0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'universal',35=>'numbersign',36=>'existential',37=>'percent',38=>'ampersand',39=>'suchthat',40=>'parenleft',41=>'parenright',42=>'asteriskmath',43=>'plus',44=>'comma',45=>'minus',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'congruent',65=>'Alpha',66=>'Beta',67=>'Chi',68=>'Delta',69=>'Epsilon',70=>'Phi',71=>'Gamma',72=>'Eta',73=>'Iota',74=>'theta1',75=>'Kappa',76=>'Lambda',77=>'Mu',78=>'Nu',79=>'Omicron',80=>'Pi',81=>'Theta',82=>'Rho',83=>'Sigma',84=>'Tau',85=>'Upsilon',86=>'sigma1',87=>'Omega',88=>'Xi',89=>'Psi',90=>'Zeta',91=>'bracketleft',92=>'therefor',93=>'bracketright',94=>'perpendicular',95=>'underscore',96=>'radicalex',97=>'alpha',98=>'beta',99=>'chi',100=>'delta',101=>'epsilon',102=>'phi',103=>'gamma',104=>'eta',105=>'iota',106=>'phi1',107=>'kappa',108=>'lambda',109=>'mu',110=>'nu',111=>'omicron',112=>'pi',113=>'theta',114=>'rho',115=>'sigma',116=>'tau',117=>'upsilon',118=>'omega1',119=>'omega',120=>'xi',121=>'psi',122=>'zeta',123=>'braceleft',124=>'bar',125=>'braceright',126=>'similar',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'Euro',161=>'Upsilon1',162=>'minute',163=>'lessequal',164=>'fraction',165=>'infinity',166=>'florin',167=>'club',168=>'diamond',169=>'heart',170=>'spade',171=>'arrowboth',172=>'arrowleft',173=>'arrowup',174=>'arrowright',175=>'arrowdown',176=>'degree',177=>'plusminus',178=>'second',179=>'greaterequal',180=>'multiply',181=>'proportional',182=>'partialdiff',183=>'bullet',184=>'divide',185=>'notequal',186=>'equivalence',187=>'approxequal',188=>'ellipsis',189=>'arrowvertex',190=>'arrowhorizex',191=>'carriagereturn',192=>'aleph',193=>'Ifraktur',194=>'Rfraktur',195=>'weierstrass',196=>'circlemultiply',197=>'circleplus',198=>'emptyset',199=>'intersection',200=>'union',201=>'propersuperset',202=>'reflexsuperset',203=>'notsubset',204=>'propersubset',205=>'reflexsubset',206=>'element',207=>'notelement',208=>'angle',209=>'gradient',210=>'registerserif',211=>'copyrightserif',212=>'trademarkserif',213=>'product',214=>'radical',215=>'dotmath',216=>'logicalnot',217=>'logicaland',218=>'logicalor',219=>'arrowdblboth',220=>'arrowdblleft',221=>'arrowdblup',222=>'arrowdblright',223=>'arrowdbldown',224=>'lozenge',225=>'angleleft',226=>'registersans',227=>'copyrightsans',228=>'trademarksans',229=>'summation',230=>'parenlefttp',231=>'parenleftex',232=>'parenleftbt',233=>'bracketlefttp',234=>'bracketleftex',235=>'bracketleftbt',236=>'bracelefttp',237=>'braceleftmid',238=>'braceleftbt',239=>'braceex',240=>'.notdef',241=>'angleright',242=>'integral',243=>'integraltp',244=>'integralex',245=>'integralbt',246=>'parenrighttp',247=>'parenrightex',248=>'parenrightbt',249=>'bracketrighttp',250=>'bracketrightex',251=>'bracketrightbt',252=>'bracerighttp',253=>'bracerightmid',254=>'bracerightbt',255=>'.notdef',1226=>'registered',1227=>'copyright',1228=>'trademark'],
]; // end of encoding maps ]; // end of encoding maps

View File

@ -905,7 +905,7 @@ class TCPDF_STATIC {
if (isset($prop['doNotSpellCheck']) && ($prop['doNotSpellCheck'] === 'true')) { if (isset($prop['doNotSpellCheck']) && ($prop['doNotSpellCheck'] === 'true')) {
$ff += 1 << 22; $ff += 1 << 22;
} }
// doNotScroll: If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field. // doNotScroll: If true, the text field does not scroll and the user, therefor, is limited by the rectangular region designed for the field.
if (isset($prop['doNotScroll']) && ($prop['doNotScroll'] === 'true')) { if (isset($prop['doNotScroll']) && ($prop['doNotScroll'] === 'true')) {
$ff += 1 << 23; $ff += 1 << 23;
} }