Unmixing line endings. No functional change.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9038 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
+24
-24
@@ -1,25 +1,25 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
|
||||||
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
<!ENTITY ns_ai "http://ns.adobe.com/AdobeIllustrator/10.0/">
|
||||||
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
|
||||||
]>
|
]>
|
||||||
<svg version="1.1" id="Layer_1" xmlns:i="&ns_ai;"
|
<svg version="1.1" id="Layer_1" xmlns:i="&ns_ai;"
|
||||||
xmlns="&ns_svg;" width="20.5" height="24.5" viewBox="0 0 20.5 24.5"
|
xmlns="&ns_svg;" width="20.5" height="24.5" viewBox="0 0 20.5 24.5"
|
||||||
overflow="visible" enable-background="new 0 0 20.5 24.5" xml:space="preserve">
|
overflow="visible" enable-background="new 0 0 20.5 24.5" xml:space="preserve">
|
||||||
<g i:extraneous="self">
|
<g i:extraneous="self">
|
||||||
<rect x="0.25" y="0.25" opacity="0" stroke="#000000" stroke-width="1" width="20" height="24"/>
|
<rect x="0.25" y="0.25" opacity="0" stroke="#000000" stroke-width="1" width="20" height="24"/>
|
||||||
<g id="XMLID_2_">
|
<g id="XMLID_2_">
|
||||||
<g>
|
<g>
|
||||||
<polygon fill="#FF0000" points="10.12,0.6 19.93,7.71 10.06,24.03 0.6,7.58 "/>
|
<polygon fill="#FF0000" points="10.12,0.6 19.93,7.71 10.06,24.03 0.6,7.58 "/>
|
||||||
</g>
|
</g>
|
||||||
<g>
|
<g>
|
||||||
<polyline fill="none" stroke="#000000" stroke-width="1" points="9.98,24.16 10.06,24.03 19.93,7.71 20.06,7.49 "/>
|
<polyline fill="none" stroke="#000000" stroke-width="1" points="9.98,24.16 10.06,24.03 19.93,7.71 20.06,7.49 "/>
|
||||||
<polyline fill="none" stroke="#000000" stroke-width="1" points="10.13,24.16 10.06,24.03 0.6,7.58 0.5,7.41 "/>
|
<polyline fill="none" stroke="#000000" stroke-width="1" points="10.13,24.16 10.06,24.03 0.6,7.58 0.5,7.41 "/>
|
||||||
<polyline fill="none" stroke="#000000" stroke-width="1" points="0.41,7.72 0.6,7.58 10.12,0.6 10.29,0.47 "/>
|
<polyline fill="none" stroke="#000000" stroke-width="1" points="0.41,7.72 0.6,7.58 10.12,0.6 10.29,0.47 "/>
|
||||||
<polyline fill="none" stroke="#000000" stroke-width="1" points="9.94,0.47 10.12,0.6 19.93,7.71 20.06,7.8 "/>
|
<polyline fill="none" stroke="#000000" stroke-width="1" points="9.94,0.47 10.12,0.6 19.93,7.71 20.06,7.8 "/>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
<ellipse stroke="#000000" stroke-width="1" cx="10.125" cy="9.25" rx="1.5" ry="1.5"/>
|
<ellipse stroke="#000000" stroke-width="1" cx="10.125" cy="9.25" rx="1.5" ry="1.5"/>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
+49
-49
@@ -1,49 +1,49 @@
|
|||||||
Customizing OpenLayers
|
Customizing OpenLayers
|
||||||
======================
|
======================
|
||||||
|
|
||||||
OpenLayers is designed to fit many needs -- fitting in alongside all kinds of
|
OpenLayers is designed to fit many needs -- fitting in alongside all kinds of
|
||||||
various applications which are currently in use.
|
various applications which are currently in use.
|
||||||
|
|
||||||
Currently, OpenLayers supports a 'theme' option when creating a map. This
|
Currently, OpenLayers supports a 'theme' option when creating a map. This
|
||||||
theme option allows you to specify the location of a CSS theme which should
|
theme option allows you to specify the location of a CSS theme which should
|
||||||
be included.
|
be included.
|
||||||
|
|
||||||
A default theme is available as an example in the theme/ directory: the setup
|
A default theme is available as an example in the theme/ directory: the setup
|
||||||
is:
|
is:
|
||||||
|
|
||||||
* theme/
|
* theme/
|
||||||
* theme/default/
|
* theme/default/
|
||||||
* theme/default/style.css
|
* theme/default/style.css
|
||||||
* theme/default/img/
|
* theme/default/img/
|
||||||
|
|
||||||
Currently, the OpenLayers code does not support class names, and therefore,
|
Currently, the OpenLayers code does not support class names, and therefore,
|
||||||
it is not possible to control many aspects of OpenLayers code with CSS
|
it is not possible to control many aspects of OpenLayers code with CSS
|
||||||
classes. However, with this framework in place, we expect to invest time
|
classes. However, with this framework in place, we expect to invest time
|
||||||
to make existing features and new features use the CSS theming framework
|
to make existing features and new features use the CSS theming framework
|
||||||
where apropriate.
|
where apropriate.
|
||||||
|
|
||||||
|
|
||||||
Class Naming
|
Class Naming
|
||||||
============
|
============
|
||||||
Elements should have class names which are descriptive of the Javascript
|
Elements should have class names which are descriptive of the Javascript
|
||||||
class from which they come. For example, the main layer switcher element
|
class from which they come. For example, the main layer switcher element
|
||||||
in the OpenLayers.Control.LayerSwitcher would be classed:
|
in the OpenLayers.Control.LayerSwitcher would be classed:
|
||||||
|
|
||||||
olControlLayerSwitcher
|
olControlLayerSwitcher
|
||||||
|
|
||||||
This would allow users to add to their style.css class in their theme,
|
This would allow users to add to their style.css class in their theme,
|
||||||
changing, for example:
|
changing, for example:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
.olControlLayerSwitcher input {
|
.olControlLayerSwitcher input {
|
||||||
width:10px;
|
width:10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sub elements of a particular control can add to the class name:
|
Sub elements of a particular control can add to the class name:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
.olControlLayerSwitcherBaseLabel {
|
.olControlLayerSwitcherBaseLabel {
|
||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -1,7 +1,7 @@
|
|||||||
Automatically generated OpenLayers API documentation is online:
|
Automatically generated OpenLayers API documentation is online:
|
||||||
|
|
||||||
http://dev.openlayers.org/apidocs
|
http://dev.openlayers.org/apidocs
|
||||||
|
|
||||||
More information on documentation is available from:
|
More information on documentation is available from:
|
||||||
|
|
||||||
http://trac.openlayers.org/wiki/Documentation
|
http://trac.openlayers.org/wiki/Documentation
|
||||||
|
|||||||
@@ -1,56 +1,56 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Pan and Zoom Panels</title>
|
<title>Pan and Zoom Panels</title>
|
||||||
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
-- Special stylesheet inclusion for ie6, which doesn't handle the alpha
|
-- Special stylesheet inclusion for ie6, which doesn't handle the alpha
|
||||||
-- channel of images correctly. The special ie6 stylesheet will only
|
-- channel of images correctly. The special ie6 stylesheet will only
|
||||||
-- be included if the browser running is ie6. For now, the only thing it
|
-- be included if the browser running is ie6. For now, the only thing it
|
||||||
-- does is load alternative, non-alpha pngs for the zoom/pan panels.
|
-- does is load alternative, non-alpha pngs for the zoom/pan panels.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<!--[if lte IE 6]>
|
<!--[if lte IE 6]>
|
||||||
<link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
<link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
|
|
||||||
<link rel="stylesheet" href="style.css" type="text/css" />
|
<link rel="stylesheet" href="style.css" type="text/css" />
|
||||||
<script type="text/javascript" src="../lib/OpenLayers.js"></script>
|
<script type="text/javascript" src="../lib/OpenLayers.js"></script>
|
||||||
<script>
|
<script>
|
||||||
var map;
|
var map;
|
||||||
var lon = 5;
|
var lon = 5;
|
||||||
var lat = 40;
|
var lat = 40;
|
||||||
var zoom = 5;
|
var zoom = 5;
|
||||||
function init(){
|
function init(){
|
||||||
map = new OpenLayers.Map("map", {
|
map = new OpenLayers.Map("map", {
|
||||||
controls: [
|
controls: [
|
||||||
new OpenLayers.Control.Navigation(),
|
new OpenLayers.Control.Navigation(),
|
||||||
new OpenLayers.Control.PanPanel(),
|
new OpenLayers.Control.PanPanel(),
|
||||||
new OpenLayers.Control.ZoomPanel()
|
new OpenLayers.Control.ZoomPanel()
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
var wms = new OpenLayers.Layer.WMS(
|
var wms = new OpenLayers.Layer.WMS(
|
||||||
"OpenLayers WMS",
|
"OpenLayers WMS",
|
||||||
"http://labs.metacarta.com/wms/vmap0",
|
"http://labs.metacarta.com/wms/vmap0",
|
||||||
{layers: 'basic'}
|
{layers: 'basic'}
|
||||||
);
|
);
|
||||||
map.addLayers([wms]);
|
map.addLayers([wms]);
|
||||||
|
|
||||||
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload='init();'>
|
<body onload='init();'>
|
||||||
<h1 id="title">Pan and Zoom Panels</h1>
|
<h1 id="title">Pan and Zoom Panels</h1>
|
||||||
<div id="tags"></div>
|
<div id="tags"></div>
|
||||||
<p id="shortdesc">Customizable pan and zoom panels</p>
|
<p id="shortdesc">Customizable pan and zoom panels</p>
|
||||||
</p>
|
</p>
|
||||||
<div id="map" class="smallmap"></div>
|
<div id="map" class="smallmap"></div>
|
||||||
<p id="docs">
|
<p id="docs">
|
||||||
The pan and zoom panels allow you to use CSS styling to change the
|
The pan and zoom panels allow you to use CSS styling to change the
|
||||||
look and feel of the panels, including changing their position
|
look and feel of the panels, including changing their position
|
||||||
and their icons without needing to change any code.
|
and their icons without needing to change any code.
|
||||||
</p>
|
</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,85 +1,85 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Control.js
|
* @requires OpenLayers/Control.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Control.Pan
|
* Class: OpenLayers.Control.Pan
|
||||||
* The Pan control is a single button to pan the map in one direction. For
|
* The Pan control is a single button to pan the map in one direction. For
|
||||||
* a more complete control see <OpenLayers.Control.PanPanel>.
|
* a more complete control see <OpenLayers.Control.PanPanel>.
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Control>
|
* - <OpenLayers.Control>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
OpenLayers.Control.Pan = OpenLayers.Class(OpenLayers.Control, {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: slideFactor
|
* APIProperty: slideFactor
|
||||||
* {Integer} Number of pixels by which we'll pan the map in any direction
|
* {Integer} Number of pixels by which we'll pan the map in any direction
|
||||||
* on clicking the arrow buttons.
|
* on clicking the arrow buttons.
|
||||||
*/
|
*/
|
||||||
slideFactor: 50,
|
slideFactor: 50,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: direction
|
* Property: direction
|
||||||
* {String} in {'North', 'South', 'East', 'West'}
|
* {String} in {'North', 'South', 'East', 'West'}
|
||||||
*/
|
*/
|
||||||
direction: null,
|
direction: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: type
|
* Property: type
|
||||||
* {String} The type of <OpenLayers.Control> -- When added to a
|
* {String} The type of <OpenLayers.Control> -- When added to a
|
||||||
* <Control.Panel>, 'type' is used by the panel to determine how to
|
* <Control.Panel>, 'type' is used by the panel to determine how to
|
||||||
* handle our events.
|
* handle our events.
|
||||||
*/
|
*/
|
||||||
type: OpenLayers.Control.TYPE_BUTTON,
|
type: OpenLayers.Control.TYPE_BUTTON,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: OpenLayers.Control.Pan
|
* Constructor: OpenLayers.Control.Pan
|
||||||
* Control which handles the panning (in any of the cardinal directions)
|
* Control which handles the panning (in any of the cardinal directions)
|
||||||
* of the map by a set px distance.
|
* of the map by a set px distance.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* direction - {String} The direction this button should pan.
|
* direction - {String} The direction this button should pan.
|
||||||
* options - {Object} An optional object whose properties will be used
|
* options - {Object} An optional object whose properties will be used
|
||||||
* to extend the control.
|
* to extend the control.
|
||||||
*/
|
*/
|
||||||
initialize: function(direction, options) {
|
initialize: function(direction, options) {
|
||||||
|
|
||||||
this.direction = direction;
|
this.direction = direction;
|
||||||
this.CLASS_NAME += this.direction;
|
this.CLASS_NAME += this.direction;
|
||||||
|
|
||||||
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
OpenLayers.Control.prototype.initialize.apply(this, [options]);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: trigger
|
* Method: trigger
|
||||||
*/
|
*/
|
||||||
trigger: function(){
|
trigger: function(){
|
||||||
|
|
||||||
switch (this.direction) {
|
switch (this.direction) {
|
||||||
case OpenLayers.Control.Pan.NORTH:
|
case OpenLayers.Control.Pan.NORTH:
|
||||||
this.map.pan(0, -this.slideFactor);
|
this.map.pan(0, -this.slideFactor);
|
||||||
break;
|
break;
|
||||||
case OpenLayers.Control.Pan.SOUTH:
|
case OpenLayers.Control.Pan.SOUTH:
|
||||||
this.map.pan(0, this.slideFactor);
|
this.map.pan(0, this.slideFactor);
|
||||||
break;
|
break;
|
||||||
case OpenLayers.Control.Pan.WEST:
|
case OpenLayers.Control.Pan.WEST:
|
||||||
this.map.pan(-this.slideFactor, 0);
|
this.map.pan(-this.slideFactor, 0);
|
||||||
break;
|
break;
|
||||||
case OpenLayers.Control.Pan.EAST:
|
case OpenLayers.Control.Pan.EAST:
|
||||||
this.map.pan(this.slideFactor, 0);
|
this.map.pan(this.slideFactor, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Control.Pan"
|
CLASS_NAME: "OpenLayers.Control.Pan"
|
||||||
});
|
});
|
||||||
|
|
||||||
OpenLayers.Control.Pan.NORTH = "North";
|
OpenLayers.Control.Pan.NORTH = "North";
|
||||||
OpenLayers.Control.Pan.SOUTH = "South";
|
OpenLayers.Control.Pan.SOUTH = "South";
|
||||||
OpenLayers.Control.Pan.EAST = "East";
|
OpenLayers.Control.Pan.EAST = "East";
|
||||||
OpenLayers.Control.Pan.WEST = "West";
|
OpenLayers.Control.Pan.WEST = "West";
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Control/Panel.js
|
* @requires OpenLayers/Control/Panel.js
|
||||||
* @requires OpenLayers/Control/Pan.js
|
* @requires OpenLayers/Control/Pan.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Control.PanPanel
|
* Class: OpenLayers.Control.PanPanel
|
||||||
* The PanPanel is visible control for panning the map North, South, East or
|
* The PanPanel is visible control for panning the map North, South, East or
|
||||||
* West in small steps. By default it is drawn in the top left corner of the
|
* West in small steps. By default it is drawn in the top left corner of the
|
||||||
* map.
|
* map.
|
||||||
*
|
*
|
||||||
* Note: If you wish to use this class with the default images and you want
|
* Note: If you wish to use this class with the default images and you want
|
||||||
* it to look nice in ie6, you should add the following, conditionally
|
* it to look nice in ie6, you should add the following, conditionally
|
||||||
* added css stylesheet to your HTML file:
|
* added css stylesheet to your HTML file:
|
||||||
*
|
*
|
||||||
* <!--[if lte IE 6]>
|
* <!--[if lte IE 6]>
|
||||||
* <link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
* <link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
||||||
* <![endif]-->
|
* <![endif]-->
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Control.Panel>
|
* - <OpenLayers.Control.Panel>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
|
OpenLayers.Control.PanPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: OpenLayers.Control.PanPanel
|
* Constructor: OpenLayers.Control.PanPanel
|
||||||
* Add the four directional pan buttons.
|
* Add the four directional pan buttons.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* options - {Object} An optional object whose properties will be used
|
* options - {Object} An optional object whose properties will be used
|
||||||
* to extend the control.
|
* to extend the control.
|
||||||
*/
|
*/
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
|
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
|
||||||
this.addControls([
|
this.addControls([
|
||||||
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),
|
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH),
|
||||||
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),
|
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH),
|
||||||
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),
|
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST),
|
||||||
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)
|
new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST)
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Control.PanPanel"
|
CLASS_NAME: "OpenLayers.Control.PanPanel"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Control.js
|
* @requires OpenLayers/Control.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Control.ZoomIn
|
* Class: OpenLayers.Control.ZoomIn
|
||||||
* The ZoomIn control is a button to increase the zoom level of a map.
|
* The ZoomIn control is a button to increase the zoom level of a map.
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Control>
|
* - <OpenLayers.Control>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Control.ZoomIn = OpenLayers.Class(OpenLayers.Control, {
|
OpenLayers.Control.ZoomIn = OpenLayers.Class(OpenLayers.Control, {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: type
|
* Property: type
|
||||||
* {String} The type of <OpenLayers.Control> -- When added to a
|
* {String} The type of <OpenLayers.Control> -- When added to a
|
||||||
* <Control.Panel>, 'type' is used by the panel to determine how to
|
* <Control.Panel>, 'type' is used by the panel to determine how to
|
||||||
* handle our events.
|
* handle our events.
|
||||||
*/
|
*/
|
||||||
type: OpenLayers.Control.TYPE_BUTTON,
|
type: OpenLayers.Control.TYPE_BUTTON,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: trigger
|
* Method: trigger
|
||||||
*/
|
*/
|
||||||
trigger: function(){
|
trigger: function(){
|
||||||
this.map.zoomIn();
|
this.map.zoomIn();
|
||||||
},
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Control.ZoomIn"
|
CLASS_NAME: "OpenLayers.Control.ZoomIn"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Control.js
|
* @requires OpenLayers/Control.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Control.ZoomOut
|
* Class: OpenLayers.Control.ZoomOut
|
||||||
* The ZoomOut control is a button to decrease the zoom level of a map.
|
* The ZoomOut control is a button to decrease the zoom level of a map.
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Control>
|
* - <OpenLayers.Control>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control, {
|
OpenLayers.Control.ZoomOut = OpenLayers.Class(OpenLayers.Control, {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Property: type
|
* Property: type
|
||||||
* {String} The type of <OpenLayers.Control> -- When added to a
|
* {String} The type of <OpenLayers.Control> -- When added to a
|
||||||
* <Control.Panel>, 'type' is used by the panel to determine how to
|
* <Control.Panel>, 'type' is used by the panel to determine how to
|
||||||
* handle our events.
|
* handle our events.
|
||||||
*/
|
*/
|
||||||
type: OpenLayers.Control.TYPE_BUTTON,
|
type: OpenLayers.Control.TYPE_BUTTON,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: trigger
|
* Method: trigger
|
||||||
*/
|
*/
|
||||||
trigger: function(){
|
trigger: function(){
|
||||||
this.map.zoomOut();
|
this.map.zoomOut();
|
||||||
},
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Control.ZoomOut"
|
CLASS_NAME: "OpenLayers.Control.ZoomOut"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,50 +1,50 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Control/Panel.js
|
* @requires OpenLayers/Control/Panel.js
|
||||||
* @requires OpenLayers/Control/ZoomIn.js
|
* @requires OpenLayers/Control/ZoomIn.js
|
||||||
* @requires OpenLayers/Control/ZoomOut.js
|
* @requires OpenLayers/Control/ZoomOut.js
|
||||||
* @requires OpenLayers/Control/ZoomToMaxExtent.js
|
* @requires OpenLayers/Control/ZoomToMaxExtent.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Control.ZoomPanel
|
* Class: OpenLayers.Control.ZoomPanel
|
||||||
* The ZoomPanel control is a compact collecton of 3 zoom controls - a
|
* The ZoomPanel control is a compact collecton of 3 zoom controls - a
|
||||||
* <OpenLayers.Control.ZoomIn>, a <OpenLayers.Control.ZoomToMaxExtent>, and a
|
* <OpenLayers.Control.ZoomIn>, a <OpenLayers.Control.ZoomToMaxExtent>, and a
|
||||||
* <OpenLayers.Control.ZoomOut>. By default it is drawn in the upper left
|
* <OpenLayers.Control.ZoomOut>. By default it is drawn in the upper left
|
||||||
* corner of the map.
|
* corner of the map.
|
||||||
*
|
*
|
||||||
* Note: If you wish to use this class with the default images and you want
|
* Note: If you wish to use this class with the default images and you want
|
||||||
* it to look nice in ie6, you should add the following, conditionally
|
* it to look nice in ie6, you should add the following, conditionally
|
||||||
* added css stylesheet to your HTML file:
|
* added css stylesheet to your HTML file:
|
||||||
*
|
*
|
||||||
* <!--[if lte IE 6]>
|
* <!--[if lte IE 6]>
|
||||||
* <link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
* <link rel="stylesheet" href="../theme/default/ie6-style.css" type="text/css" />
|
||||||
* <![endif]-->
|
* <![endif]-->
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Control.Panel>
|
* - <OpenLayers.Control.Panel>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Control.ZoomPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
|
OpenLayers.Control.ZoomPanel = OpenLayers.Class(OpenLayers.Control.Panel, {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: OpenLayers.Control.ZoomPanel
|
* Constructor: OpenLayers.Control.ZoomPanel
|
||||||
* Add the three zooming controls.
|
* Add the three zooming controls.
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* options - {Object} An optional object whose properties will be used
|
* options - {Object} An optional object whose properties will be used
|
||||||
* to extend the control.
|
* to extend the control.
|
||||||
*/
|
*/
|
||||||
initialize: function(options) {
|
initialize: function(options) {
|
||||||
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
|
OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
|
||||||
this.addControls([
|
this.addControls([
|
||||||
new OpenLayers.Control.ZoomIn(),
|
new OpenLayers.Control.ZoomIn(),
|
||||||
new OpenLayers.Control.ZoomToMaxExtent(),
|
new OpenLayers.Control.ZoomToMaxExtent(),
|
||||||
new OpenLayers.Control.ZoomOut()
|
new OpenLayers.Control.ZoomOut()
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Control.ZoomPanel"
|
CLASS_NAME: "OpenLayers.Control.ZoomPanel"
|
||||||
});
|
});
|
||||||
|
|||||||
+121
-121
@@ -1,121 +1,121 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Lang.js
|
* @requires OpenLayers/Lang.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace: OpenLayers.Lang["nb"]
|
* Namespace: OpenLayers.Lang["nb"]
|
||||||
* Dictionary for norwegian bokmål (Norway). Keys for entries are used in calls to
|
* Dictionary for norwegian bokmål (Norway). Keys for entries are used in calls to
|
||||||
* <OpenLayers.Lang.translate>. Entry bodies are normal strings or
|
* <OpenLayers.Lang.translate>. Entry bodies are normal strings or
|
||||||
* strings formatted for use with <OpenLayers.String.format> calls.
|
* strings formatted for use with <OpenLayers.String.format> calls.
|
||||||
*/
|
*/
|
||||||
OpenLayers.Lang["nb"] = {
|
OpenLayers.Lang["nb"] = {
|
||||||
|
|
||||||
'unhandledRequest': "Ubehandlet forespørsel returnerte ${statusText}",
|
'unhandledRequest': "Ubehandlet forespørsel returnerte ${statusText}",
|
||||||
|
|
||||||
'permalink': "Kobling til denne siden",
|
'permalink': "Kobling til denne siden",
|
||||||
|
|
||||||
'overlays': "Kartlag",
|
'overlays': "Kartlag",
|
||||||
|
|
||||||
'baseLayer': "Bakgrunnskart",
|
'baseLayer': "Bakgrunnskart",
|
||||||
|
|
||||||
'sameProjection':
|
'sameProjection':
|
||||||
"Oversiktskartet fungerer bare når det har samme projeksjon som hovedkartet",
|
"Oversiktskartet fungerer bare når det har samme projeksjon som hovedkartet",
|
||||||
|
|
||||||
'readNotImplemented': "Lesing er ikke implementert.",
|
'readNotImplemented': "Lesing er ikke implementert.",
|
||||||
|
|
||||||
'writeNotImplemented': "Skriving er ikke implementert.",
|
'writeNotImplemented': "Skriving er ikke implementert.",
|
||||||
|
|
||||||
'noFID': "Kan ikke oppdatere feature (objekt) som ikke har FID.",
|
'noFID': "Kan ikke oppdatere feature (objekt) som ikke har FID.",
|
||||||
|
|
||||||
'errorLoadingGML': "Feil under lasting av GML-fil ${url}",
|
'errorLoadingGML': "Feil under lasting av GML-fil ${url}",
|
||||||
|
|
||||||
'browserNotSupported':
|
'browserNotSupported':
|
||||||
"Din nettleser støtter ikke vektortegning. Følgende tegnemetoder støttes:\n${renderers}",
|
"Din nettleser støtter ikke vektortegning. Følgende tegnemetoder støttes:\n${renderers}",
|
||||||
|
|
||||||
'componentShouldBe': "addFeatures : komponenten må være en ${geomType}",
|
'componentShouldBe': "addFeatures : komponenten må være en ${geomType}",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'getFeatureError':
|
'getFeatureError':
|
||||||
"getFeatureFromEvent kjørt mot lag uten tegnemetode. Dette betyr som regel at du " +
|
"getFeatureFromEvent kjørt mot lag uten tegnemetode. Dette betyr som regel at du " +
|
||||||
"fjernet et lag uten å fjerne alle handlere tilknyttet laget.",
|
"fjernet et lag uten å fjerne alle handlere tilknyttet laget.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'minZoomLevelError':
|
'minZoomLevelError':
|
||||||
"Egenskapen minZoomLevel er kun tenkt for bruk på lag " +
|
"Egenskapen minZoomLevel er kun tenkt for bruk på lag " +
|
||||||
"basert på FixedZoomLevels. At dette wfs-laget sjekker " +
|
"basert på FixedZoomLevels. At dette wfs-laget sjekker " +
|
||||||
"minZoomLevel er en fortidslevning. Det kan dog ikke " +
|
"minZoomLevel er en fortidslevning. Det kan dog ikke " +
|
||||||
"tas bort uten å risikere at OL-baserte applikasjoner " +
|
"tas bort uten å risikere at OL-baserte applikasjoner " +
|
||||||
"slutter å virke, så det er merket som foreldet: " +
|
"slutter å virke, så det er merket som foreldet: " +
|
||||||
"minZoomLevel i sjekken nedenfor vil fjernes i 3.0. " +
|
"minZoomLevel i sjekken nedenfor vil fjernes i 3.0. " +
|
||||||
"Vennligst bruk innstillingene for min/maks oppløsning " +
|
"Vennligst bruk innstillingene for min/maks oppløsning " +
|
||||||
"som er beskrevet her: "+
|
"som er beskrevet her: "+
|
||||||
"http://trac.openlayers.org/wiki/SettingZoomLevels",
|
"http://trac.openlayers.org/wiki/SettingZoomLevels",
|
||||||
|
|
||||||
'commitSuccess': "WFS-transaksjon: SUKSESS ${response}",
|
'commitSuccess': "WFS-transaksjon: SUKSESS ${response}",
|
||||||
|
|
||||||
'commitFailed': "WFS-transaksjon: FEILET ${response}",
|
'commitFailed': "WFS-transaksjon: FEILET ${response}",
|
||||||
|
|
||||||
'googleWarning':
|
'googleWarning':
|
||||||
"Google-laget kunne ikke lastes.<br><br>" +
|
"Google-laget kunne ikke lastes.<br><br>" +
|
||||||
"Bytt til et annet bakgrunnslag i lagvelgeren i " +
|
"Bytt til et annet bakgrunnslag i lagvelgeren i " +
|
||||||
"øvre høyre hjørne for å slippe denne meldingen.<br><br>" +
|
"øvre høyre hjørne for å slippe denne meldingen.<br><br>" +
|
||||||
"Sannsynligvis forårsakes feilen av at Google Maps-biblioteket " +
|
"Sannsynligvis forårsakes feilen av at Google Maps-biblioteket " +
|
||||||
"ikke er riktig inkludert på nettsiden, eller at det ikke er " +
|
"ikke er riktig inkludert på nettsiden, eller at det ikke er " +
|
||||||
"angitt riktig API-nøkkel for nettstedet.<br><br>" +
|
"angitt riktig API-nøkkel for nettstedet.<br><br>" +
|
||||||
"Utviklere: For hjelp til å få dette til å virke se "+
|
"Utviklere: For hjelp til å få dette til å virke se "+
|
||||||
"<a href='http://trac.openlayers.org/wiki/Google' " +
|
"<a href='http://trac.openlayers.org/wiki/Google' " +
|
||||||
"target='_blank'>her</a>.",
|
"target='_blank'>her</a>.",
|
||||||
|
|
||||||
'getLayerWarning':
|
'getLayerWarning':
|
||||||
"${layerType}-laget kunne ikke lastes.<br><br>" +
|
"${layerType}-laget kunne ikke lastes.<br><br>" +
|
||||||
"Bytt til et annet bakgrunnslag i lagvelgeren i " +
|
"Bytt til et annet bakgrunnslag i lagvelgeren i " +
|
||||||
"øvre høyre hjørne for å slippe denne meldingen.<br><br>" +
|
"øvre høyre hjørne for å slippe denne meldingen.<br><br>" +
|
||||||
"Sannsynligvis forårsakes feilen av at " +
|
"Sannsynligvis forårsakes feilen av at " +
|
||||||
"${layerLib}-biblioteket ikke var riktig inkludert " +
|
"${layerLib}-biblioteket ikke var riktig inkludert " +
|
||||||
"på nettsiden.<br><br>" +
|
"på nettsiden.<br><br>" +
|
||||||
"Utviklere: For hjelp til å få dette til å virke se " +
|
"Utviklere: For hjelp til å få dette til å virke se " +
|
||||||
"<a href='http://trac.openlayers.org/wiki/${layerLib}' " +
|
"<a href='http://trac.openlayers.org/wiki/${layerLib}' " +
|
||||||
"target='_blank'>her</a>.",
|
"target='_blank'>her</a>.",
|
||||||
|
|
||||||
'scale': "<strong>Skala</strong> 1 : ${scaleDenom}",
|
'scale': "<strong>Skala</strong> 1 : ${scaleDenom}",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'layerAlreadyAdded':
|
'layerAlreadyAdded':
|
||||||
"Du forsøkte å legge til laget ${layerName} på kartet, men det er allerede lagt til",
|
"Du forsøkte å legge til laget ${layerName} på kartet, men det er allerede lagt til",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'reprojectDeprecated':
|
'reprojectDeprecated':
|
||||||
"Du bruker innstillingen 'reproject' på laget ${layerName}. " +
|
"Du bruker innstillingen 'reproject' på laget ${layerName}. " +
|
||||||
"Denne innstillingen er foreldet, den var ment for å støtte " +
|
"Denne innstillingen er foreldet, den var ment for å støtte " +
|
||||||
"visning av kartdata over kommersielle bakgrunnskart, men det " +
|
"visning av kartdata over kommersielle bakgrunnskart, men det " +
|
||||||
"bør nå gjøres med støtten for Spherical Mercator. Mer informasjon " +
|
"bør nå gjøres med støtten for Spherical Mercator. Mer informasjon " +
|
||||||
"finnes på " +
|
"finnes på " +
|
||||||
"http://trac.openlayers.org/wiki/SphericalMercator.",
|
"http://trac.openlayers.org/wiki/SphericalMercator.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'methodDeprecated':
|
'methodDeprecated':
|
||||||
"Denne metoden er markert som foreldet og vil bli fjernet i 3.0. " +
|
"Denne metoden er markert som foreldet og vil bli fjernet i 3.0. " +
|
||||||
"Bruk ${newMethod} i stedet.",
|
"Bruk ${newMethod} i stedet.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'boundsAddError': "Du må gi både x- og y-verdier til funksjonen add.",
|
'boundsAddError': "Du må gi både x- og y-verdier til funksjonen add.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'lonlatAddError': "Du må gi både lon- og lat-verdier til funksjonen add.",
|
'lonlatAddError': "Du må gi både lon- og lat-verdier til funksjonen add.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'pixelAddError': "Du må gi både x- og y-verdier til funksjonen add.",
|
'pixelAddError': "Du må gi både x- og y-verdier til funksjonen add.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'unsupportedGeometryType': "Ustøttet geometritype: ${geomType}",
|
'unsupportedGeometryType': "Ustøttet geometritype: ${geomType}",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'pagePositionFailed':
|
'pagePositionFailed':
|
||||||
"OpenLayers.Util.pagePosition feilet: elementet med id ${elemId} kan være feilplassert.",
|
"OpenLayers.Util.pagePosition feilet: elementet med id ${elemId} kan være feilplassert.",
|
||||||
|
|
||||||
'end': ''
|
'end': ''
|
||||||
};
|
};
|
||||||
|
|||||||
+121
-121
@@ -1,121 +1,121 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Lang.js
|
* @requires OpenLayers/Lang.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace: OpenLayers.Lang["sv-SE"]
|
* Namespace: OpenLayers.Lang["sv-SE"]
|
||||||
* Dictionary for swedish (Sweden). Keys for entries are used in calls to
|
* Dictionary for swedish (Sweden). Keys for entries are used in calls to
|
||||||
* <OpenLayers.Lang.translate>. Entry bodies are normal strings or
|
* <OpenLayers.Lang.translate>. Entry bodies are normal strings or
|
||||||
* strings formatted for use with <OpenLayers.String.format> calls.
|
* strings formatted for use with <OpenLayers.String.format> calls.
|
||||||
*/
|
*/
|
||||||
OpenLayers.Lang["sv-SE"] = {
|
OpenLayers.Lang["sv-SE"] = {
|
||||||
|
|
||||||
'unhandledRequest': "Ej hanterad fråga retur ${statusText}",
|
'unhandledRequest': "Ej hanterad fråga retur ${statusText}",
|
||||||
|
|
||||||
'permalink': "Permalänk",
|
'permalink': "Permalänk",
|
||||||
|
|
||||||
'overlays': "Kartlager",
|
'overlays': "Kartlager",
|
||||||
|
|
||||||
'baseLayer': "Bakgrundskarta",
|
'baseLayer': "Bakgrundskarta",
|
||||||
|
|
||||||
'sameProjection':
|
'sameProjection':
|
||||||
"Översiktskartan fungerar endast när den har samma projektion som huvudkartan",
|
"Översiktskartan fungerar endast när den har samma projektion som huvudkartan",
|
||||||
|
|
||||||
'readNotImplemented': "Läsning ej implementerad.",
|
'readNotImplemented': "Läsning ej implementerad.",
|
||||||
|
|
||||||
'writeNotImplemented': "Skrivning ej implementerad.",
|
'writeNotImplemented': "Skrivning ej implementerad.",
|
||||||
|
|
||||||
'noFID': "Kan ej uppdatera feature (objekt) för vilket FID saknas.",
|
'noFID': "Kan ej uppdatera feature (objekt) för vilket FID saknas.",
|
||||||
|
|
||||||
'errorLoadingGML': "Fel i laddning av GML-fil ${url}",
|
'errorLoadingGML': "Fel i laddning av GML-fil ${url}",
|
||||||
|
|
||||||
'browserNotSupported':
|
'browserNotSupported':
|
||||||
"Din webbläsare stöder inte vektorvisning. För närvarande stöds följande visning:\n${renderers}",
|
"Din webbläsare stöder inte vektorvisning. För närvarande stöds följande visning:\n${renderers}",
|
||||||
|
|
||||||
'componentShouldBe': "addFeatures : komponenten skall vara en ${geomType}",
|
'componentShouldBe': "addFeatures : komponenten skall vara en ${geomType}",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'getFeatureError':
|
'getFeatureError':
|
||||||
"getFeatureFromEvent anropad för lager utan utritning. Detta betyder oftast att man " +
|
"getFeatureFromEvent anropad för lager utan utritning. Detta betyder oftast att man " +
|
||||||
"raderat ett lager, men inte en hanterare som är knuten till lagret.",
|
"raderat ett lager, men inte en hanterare som är knuten till lagret.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'minZoomLevelError':
|
'minZoomLevelError':
|
||||||
"Egenskapen minZoomLevel är endast avsedd att användas " +
|
"Egenskapen minZoomLevel är endast avsedd att användas " +
|
||||||
"med lager med FixedZoomLevels. Att detta WFS-lager " +
|
"med lager med FixedZoomLevels. Att detta WFS-lager " +
|
||||||
"kontrollerar minZoomLevel är en relik från äldre versioner. " +
|
"kontrollerar minZoomLevel är en relik från äldre versioner. " +
|
||||||
"Vi kan dock inte ta bort det utan att riskera att " +
|
"Vi kan dock inte ta bort det utan att riskera att " +
|
||||||
"OL-baserade tillämpningar som använder detta slutar " +
|
"OL-baserade tillämpningar som använder detta slutar " +
|
||||||
"fungera. Därför är det satt som deprecated, minZoomLevel " +
|
"fungera. Därför är det satt som deprecated, minZoomLevel " +
|
||||||
"kommer att tas bort i version 3.0. Använd i stället " +
|
"kommer att tas bort i version 3.0. Använd i stället " +
|
||||||
"inställning av min/max resolution som beskrivs här: " +
|
"inställning av min/max resolution som beskrivs här: " +
|
||||||
"http://trac.openlayers.org/wiki/SettingZoomLevels",
|
"http://trac.openlayers.org/wiki/SettingZoomLevels",
|
||||||
|
|
||||||
'commitSuccess': "WFS-transaktion: LYCKADES ${response}",
|
'commitSuccess': "WFS-transaktion: LYCKADES ${response}",
|
||||||
|
|
||||||
'commitFailed': "WFS-transaktion: MISSLYCKADES ${response}",
|
'commitFailed': "WFS-transaktion: MISSLYCKADES ${response}",
|
||||||
|
|
||||||
'googleWarning':
|
'googleWarning':
|
||||||
"Google-lagret kunde inte laddas korrekt.<br><br>" +
|
"Google-lagret kunde inte laddas korrekt.<br><br>" +
|
||||||
"För att slippa detta meddelande, välj en annan bakgrundskarta " +
|
"För att slippa detta meddelande, välj en annan bakgrundskarta " +
|
||||||
"i lagerväljaren i övre högra hörnet.<br><br>" +
|
"i lagerväljaren i övre högra hörnet.<br><br>" +
|
||||||
"Sannolikt beror felet på att Google Maps-biblioteket " +
|
"Sannolikt beror felet på att Google Maps-biblioteket " +
|
||||||
"inte är inkluderat på webbsidan eller på att sidan " +
|
"inte är inkluderat på webbsidan eller på att sidan " +
|
||||||
"inte anger korrekt API-nyckel för webbplatsen.<br><br>" +
|
"inte anger korrekt API-nyckel för webbplatsen.<br><br>" +
|
||||||
"Utvecklare: hjälp för att åtgärda detta, " +
|
"Utvecklare: hjälp för att åtgärda detta, " +
|
||||||
"<a href='http://trac.openlayers.org/wiki/Google' " +
|
"<a href='http://trac.openlayers.org/wiki/Google' " +
|
||||||
"target='_blank'>klicka här</a>.",
|
"target='_blank'>klicka här</a>.",
|
||||||
|
|
||||||
'getLayerWarning':
|
'getLayerWarning':
|
||||||
"${layerType}-lagret kunde inte laddas korrekt.<br><br>" +
|
"${layerType}-lagret kunde inte laddas korrekt.<br><br>" +
|
||||||
"För att slippa detta meddelande, välj en annan bakgrundskarta " +
|
"För att slippa detta meddelande, välj en annan bakgrundskarta " +
|
||||||
"i lagerväljaren i övre högra hörnet.<br><br>" +
|
"i lagerväljaren i övre högra hörnet.<br><br>" +
|
||||||
"Sannolikt beror felet på att ${layerLib}-biblioteket " +
|
"Sannolikt beror felet på att ${layerLib}-biblioteket " +
|
||||||
"inte är inkluderat på webbsidan.<br><br>" +
|
"inte är inkluderat på webbsidan.<br><br>" +
|
||||||
"Utvecklare: hjälp för att åtgärda detta, " +
|
"Utvecklare: hjälp för att åtgärda detta, " +
|
||||||
"<a href='http://trac.openlayers.org/wiki/${layerLib}' " +
|
"<a href='http://trac.openlayers.org/wiki/${layerLib}' " +
|
||||||
"target='_blank'>klicka här</a>.",
|
"target='_blank'>klicka här</a>.",
|
||||||
|
|
||||||
'scale': "<strong>Skala</strong> 1 : ${scaleDenom}",
|
'scale': "<strong>Skala</strong> 1 : ${scaleDenom}",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'layerAlreadyAdded':
|
'layerAlreadyAdded':
|
||||||
"Du försökte lägga till lagret: ${layerName} på kartan, men det har lagts till tidigare",
|
"Du försökte lägga till lagret: ${layerName} på kartan, men det har lagts till tidigare",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'reprojectDeprecated':
|
'reprojectDeprecated':
|
||||||
"Du använder inställningen 'reproject' på lagret ${layerName}. " +
|
"Du använder inställningen 'reproject' på lagret ${layerName}. " +
|
||||||
"Denna inställning markerad som deprecated: den var avsedd " +
|
"Denna inställning markerad som deprecated: den var avsedd " +
|
||||||
"att användas för att stödja visning av kartdata på kommersiella " +
|
"att användas för att stödja visning av kartdata på kommersiella " +
|
||||||
"bakgrundskartor, men nu bör man i stället " +
|
"bakgrundskartor, men nu bör man i stället " +
|
||||||
"använda Spherical Mercator-stöd för den funktionaliteten. " +
|
"använda Spherical Mercator-stöd för den funktionaliteten. " +
|
||||||
"Mer information finns " +
|
"Mer information finns " +
|
||||||
"på http://trac.openlayers.org/wiki/SphericalMercator.",
|
"på http://trac.openlayers.org/wiki/SphericalMercator.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'methodDeprecated':
|
'methodDeprecated':
|
||||||
"Denna metod är markerad som deprecated och kommer att tas bort i 3.0. " +
|
"Denna metod är markerad som deprecated och kommer att tas bort i 3.0. " +
|
||||||
"Använd ${newMethod} i stället.",
|
"Använd ${newMethod} i stället.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'boundsAddError': "Du måste skicka både x- och y-värde till funktionen add.",
|
'boundsAddError': "Du måste skicka både x- och y-värde till funktionen add.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'lonlatAddError': "Du måste skicka både lon- och lat-värde till funktionen add.",
|
'lonlatAddError': "Du måste skicka både lon- och lat-värde till funktionen add.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'pixelAddError': "Du måste skicka både x- och y-värde till funktionen add.",
|
'pixelAddError': "Du måste skicka både x- och y-värde till funktionen add.",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'unsupportedGeometryType': "Stöd saknas för geometritypen: ${geomType}",
|
'unsupportedGeometryType': "Stöd saknas för geometritypen: ${geomType}",
|
||||||
|
|
||||||
// console message
|
// console message
|
||||||
'pagePositionFailed':
|
'pagePositionFailed':
|
||||||
"OpenLayers.Util.pagePosition misslyckades: elementet med id ${elemId} kan placeras fel.",
|
"OpenLayers.Util.pagePosition misslyckades: elementet med id ${elemId} kan placeras fel.",
|
||||||
|
|
||||||
'end': ''
|
'end': ''
|
||||||
};
|
};
|
||||||
|
|||||||
+147
-147
@@ -1,147 +1,147 @@
|
|||||||
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
/* Copyright (c) 2006-2008 MetaCarta, Inc., published under the Clear BSD
|
||||||
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
* license. See http://svn.openlayers.org/trunk/openlayers/license.txt for the
|
||||||
* full text of the license. */
|
* full text of the license. */
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @requires OpenLayers/Layer/Grid.js
|
* @requires OpenLayers/Layer/Grid.js
|
||||||
* @requires OpenLayers/Layer/KaMap.js
|
* @requires OpenLayers/Layer/KaMap.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Layer.KaMapCache
|
* Class: OpenLayers.Layer.KaMapCache
|
||||||
*
|
*
|
||||||
* This class is designed to talk directly to a web-accessible ka-Map
|
* This class is designed to talk directly to a web-accessible ka-Map
|
||||||
* cache generated by the precache2.php script.
|
* cache generated by the precache2.php script.
|
||||||
*
|
*
|
||||||
* To create a a new KaMapCache layer, you must indicate also the "i" parameter
|
* To create a a new KaMapCache layer, you must indicate also the "i" parameter
|
||||||
* (that will be used to calculate the file extension), and another special
|
* (that will be used to calculate the file extension), and another special
|
||||||
* parameter, object names "metaTileSize", with "h" (height) and "w" (width)
|
* parameter, object names "metaTileSize", with "h" (height) and "w" (width)
|
||||||
* properties.
|
* properties.
|
||||||
*
|
*
|
||||||
* // Create a new kaMapCache layer.
|
* // Create a new kaMapCache layer.
|
||||||
* var kamap_base = new OpenLayers.Layer.KaMapCache(
|
* var kamap_base = new OpenLayers.Layer.KaMapCache(
|
||||||
* "Satellite",
|
* "Satellite",
|
||||||
* "http://www.example.org/web/acessible/cache",
|
* "http://www.example.org/web/acessible/cache",
|
||||||
* {g: "satellite", map: "world", i: 'png24', metaTileSize: {w: 5, h: 5} }
|
* {g: "satellite", map: "world", i: 'png24', metaTileSize: {w: 5, h: 5} }
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* // Create an kaMapCache overlay layer (using "isBaseLayer: false").
|
* // Create an kaMapCache overlay layer (using "isBaseLayer: false").
|
||||||
* // Forces the output to be a "gif", using the "i" parameter.
|
* // Forces the output to be a "gif", using the "i" parameter.
|
||||||
* var kamap_overlay = new OpenLayers.Layer.KaMapCache(
|
* var kamap_overlay = new OpenLayers.Layer.KaMapCache(
|
||||||
* "Streets",
|
* "Streets",
|
||||||
* "http://www.example.org/web/acessible/cache",
|
* "http://www.example.org/web/acessible/cache",
|
||||||
* {g: "streets", map: "world", i: "gif", metaTileSize: {w: 5, h: 5} },
|
* {g: "streets", map: "world", i: "gif", metaTileSize: {w: 5, h: 5} },
|
||||||
* {isBaseLayer: false}
|
* {isBaseLayer: false}
|
||||||
* );
|
* );
|
||||||
*
|
*
|
||||||
* The cache URLs must look like:
|
* The cache URLs must look like:
|
||||||
* var/cache/World/50000/Group_Name/def/t-440320/l20480
|
* var/cache/World/50000/Group_Name/def/t-440320/l20480
|
||||||
*
|
*
|
||||||
* This means that the cache generated via tile.php will *not* work with
|
* This means that the cache generated via tile.php will *not* work with
|
||||||
* this class, and should instead use the KaMap layer.
|
* this class, and should instead use the KaMap layer.
|
||||||
*
|
*
|
||||||
* More information is available in Ticket #1518.
|
* More information is available in Ticket #1518.
|
||||||
*
|
*
|
||||||
* Inherits from:
|
* Inherits from:
|
||||||
* - <OpenLayers.Layer.KaMap>
|
* - <OpenLayers.Layer.KaMap>
|
||||||
* - <OpenLayers.Layer.Grid>
|
* - <OpenLayers.Layer.Grid>
|
||||||
*/
|
*/
|
||||||
OpenLayers.Layer.KaMapCache = OpenLayers.Class(OpenLayers.Layer.KaMap, {
|
OpenLayers.Layer.KaMapCache = OpenLayers.Class(OpenLayers.Layer.KaMap, {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant: IMAGE_EXTENSIONS
|
* Constant: IMAGE_EXTENSIONS
|
||||||
* {Object} Simple hash map to convert format to extension.
|
* {Object} Simple hash map to convert format to extension.
|
||||||
*/
|
*/
|
||||||
IMAGE_EXTENSIONS: {
|
IMAGE_EXTENSIONS: {
|
||||||
'jpeg': 'jpg',
|
'jpeg': 'jpg',
|
||||||
'gif' : 'gif',
|
'gif' : 'gif',
|
||||||
'png' : 'png',
|
'png' : 'png',
|
||||||
'png8' : 'png',
|
'png8' : 'png',
|
||||||
'png24' : 'png',
|
'png24' : 'png',
|
||||||
'dithered' : 'png'
|
'dithered' : 'png'
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constant: DEFAULT_FORMAT
|
* Constant: DEFAULT_FORMAT
|
||||||
* {Object} Simple hash map to convert format to extension.
|
* {Object} Simple hash map to convert format to extension.
|
||||||
*/
|
*/
|
||||||
DEFAULT_FORMAT: 'jpeg',
|
DEFAULT_FORMAT: 'jpeg',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor: OpenLayers.Layer.KaMapCache
|
* Constructor: OpenLayers.Layer.KaMapCache
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* name - {String}
|
* name - {String}
|
||||||
* url - {String}
|
* url - {String}
|
||||||
* params - {Object} Parameters to be sent to the HTTP server in the
|
* params - {Object} Parameters to be sent to the HTTP server in the
|
||||||
* query string for the tile. The format can be set via the 'i'
|
* query string for the tile. The format can be set via the 'i'
|
||||||
* parameter (defaults to jpg) , and the map should be set via
|
* parameter (defaults to jpg) , and the map should be set via
|
||||||
* the 'map' parameter. It has been reported that ka-Map may behave
|
* the 'map' parameter. It has been reported that ka-Map may behave
|
||||||
* inconsistently if your format parameter does not match the format
|
* inconsistently if your format parameter does not match the format
|
||||||
* parameter configured in your config.php. (See ticket #327 for more
|
* parameter configured in your config.php. (See ticket #327 for more
|
||||||
* information.)
|
* information.)
|
||||||
* options - {Object} Additional options for the layer. Any of the
|
* options - {Object} Additional options for the layer. Any of the
|
||||||
* APIProperties listed on this layer, and any layer types it
|
* APIProperties listed on this layer, and any layer types it
|
||||||
* extends, can be overridden through the options parameter.
|
* extends, can be overridden through the options parameter.
|
||||||
*/
|
*/
|
||||||
initialize: function(name, url, params, options) {
|
initialize: function(name, url, params, options) {
|
||||||
OpenLayers.Layer.KaMap.prototype.initialize.apply(this, arguments);
|
OpenLayers.Layer.KaMap.prototype.initialize.apply(this, arguments);
|
||||||
this.extension = this.IMAGE_EXTENSIONS[this.params.i.toLowerCase() || DEFAULT_FORMAT];
|
this.extension = this.IMAGE_EXTENSIONS[this.params.i.toLowerCase() || DEFAULT_FORMAT];
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method: getURL
|
* Method: getURL
|
||||||
*
|
*
|
||||||
* Parameters:
|
* Parameters:
|
||||||
* bounds - {<OpenLayers.Bounds>}
|
* bounds - {<OpenLayers.Bounds>}
|
||||||
*
|
*
|
||||||
* Returns:
|
* Returns:
|
||||||
* {String} A string with the layer's url and parameters and also the
|
* {String} A string with the layer's url and parameters and also the
|
||||||
* passed-in bounds and appropriate tile size specified as
|
* passed-in bounds and appropriate tile size specified as
|
||||||
* parameters
|
* parameters
|
||||||
*/
|
*/
|
||||||
getURL: function (bounds) {
|
getURL: function (bounds) {
|
||||||
bounds = this.adjustBounds(bounds);
|
bounds = this.adjustBounds(bounds);
|
||||||
var mapRes = this.map.getResolution();
|
var mapRes = this.map.getResolution();
|
||||||
var scale = Math.round((this.map.getScale() * 10000)) / 10000;
|
var scale = Math.round((this.map.getScale() * 10000)) / 10000;
|
||||||
var pX = Math.round(bounds.left / mapRes);
|
var pX = Math.round(bounds.left / mapRes);
|
||||||
var pY = -Math.round(bounds.top / mapRes);
|
var pY = -Math.round(bounds.top / mapRes);
|
||||||
|
|
||||||
var metaX = Math.floor(pX / this.tileSize.w / this.params.metaTileSize.w) * this.tileSize.w * this.params.metaTileSize.w;
|
var metaX = Math.floor(pX / this.tileSize.w / this.params.metaTileSize.w) * this.tileSize.w * this.params.metaTileSize.w;
|
||||||
var metaY = Math.floor(pY / this.tileSize.h / this.params.metaTileSize.h) * this.tileSize.h * this.params.metaTileSize.h;
|
var metaY = Math.floor(pY / this.tileSize.h / this.params.metaTileSize.h) * this.tileSize.h * this.params.metaTileSize.h;
|
||||||
|
|
||||||
// if url is not a string, it should be an array of strings,
|
// if url is not a string, it should be an array of strings,
|
||||||
// in which case we will deterministically select one of them in
|
// in which case we will deterministically select one of them in
|
||||||
// order to evenly distribute requests to different urls.
|
// order to evenly distribute requests to different urls.
|
||||||
//
|
//
|
||||||
var url = this.url;
|
var url = this.url;
|
||||||
if (url instanceof Array) {
|
if (url instanceof Array) {
|
||||||
url = this.selectUrl(paramsString, url);
|
url = this.selectUrl(paramsString, url);
|
||||||
}
|
}
|
||||||
|
|
||||||
var components = [
|
var components = [
|
||||||
url,
|
url,
|
||||||
"/",
|
"/",
|
||||||
this.params.map,
|
this.params.map,
|
||||||
"/",
|
"/",
|
||||||
scale,
|
scale,
|
||||||
"/",
|
"/",
|
||||||
this.params.g.replace(/\s/g, '_'),
|
this.params.g.replace(/\s/g, '_'),
|
||||||
"/def/t",
|
"/def/t",
|
||||||
metaY,
|
metaY,
|
||||||
"/l",
|
"/l",
|
||||||
metaX,
|
metaX,
|
||||||
"/t",
|
"/t",
|
||||||
pY,
|
pY,
|
||||||
"l",
|
"l",
|
||||||
pX,
|
pX,
|
||||||
".",
|
".",
|
||||||
this.extension
|
this.extension
|
||||||
];
|
];
|
||||||
|
|
||||||
return components.join("");
|
return components.join("");
|
||||||
},
|
},
|
||||||
|
|
||||||
CLASS_NAME: "OpenLayers.Layer.KaMapCache"
|
CLASS_NAME: "OpenLayers.Layer.KaMapCache"
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="/css/rss.css" ?>
|
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="/css/rss.css" ?>
|
||||||
|
|
||||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
xmlns="http://purl.org/rss/1.0/"
|
xmlns="http://purl.org/rss/1.0/"
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
xmlns:georss="http://www.georss.org/georss">
|
xmlns:georss="http://www.georss.org/georss">
|
||||||
<docs>This is an RSS file. Copy the URL into your aggregator of choice. If you don't know what this means and want to learn more, please see: <span>http://platial.typepad.com/news/2006/04/really_simple_t.html</span> for more info.</docs><channel rdf:about="http://platial.com">
|
<docs>This is an RSS file. Copy the URL into your aggregator of choice. If you don't know what this means and want to learn more, please see: <span>http://platial.typepad.com/news/2006/04/really_simple_t.html</span> for more info.</docs><channel rdf:about="http://platial.com">
|
||||||
<link>http://platial.com</link>
|
<link>http://platial.com</link>
|
||||||
|
|||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="/css/rss.css" ?>
|
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/css" href="/css/rss.css" ?>
|
||||||
|
|
||||||
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
xmlns="http://purl.org/rss/1.0/"
|
xmlns="http://purl.org/rss/1.0/"
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
xmlns:georss="http://www.georss.org/georss">
|
xmlns:georss="http://www.georss.org/georss">
|
||||||
<docs>This is an RSS file. Copy the URL into your aggregator of choice. If you don't know what this means and want to learn more, please see: <span>http://platial.typepad.com/news/2006/04/really_simple_t.html</span> for more info.</docs><channel rdf:about="http://platial.com">
|
<docs>This is an RSS file. Copy the URL into your aggregator of choice. If you don't know what this means and want to learn more, please see: <span>http://platial.typepad.com/news/2006/04/really_simple_t.html</span> for more info.</docs><channel rdf:about="http://platial.com">
|
||||||
<link>http://platial.com</link>
|
<link>http://platial.com</link>
|
||||||
|
|||||||
+251
-251
@@ -1,251 +1,251 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import urllib2
|
import urllib2
|
||||||
import time
|
import time
|
||||||
from xml.dom.minidom import Document
|
from xml.dom.minidom import Document
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import xml.etree.ElementTree as ElementTree
|
import xml.etree.ElementTree as ElementTree
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
import cElementTree as ElementTree
|
import cElementTree as ElementTree
|
||||||
except ImportError:
|
except ImportError:
|
||||||
try:
|
try:
|
||||||
import elementtree.ElementTree as ElementTree
|
import elementtree.ElementTree as ElementTree
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import lxml.etree as ElementTree
|
import lxml.etree as ElementTree
|
||||||
|
|
||||||
missing_deps = False
|
missing_deps = False
|
||||||
try:
|
try:
|
||||||
import simplejson
|
import simplejson
|
||||||
from BeautifulSoup import BeautifulSoup
|
from BeautifulSoup import BeautifulSoup
|
||||||
except ImportError, E:
|
except ImportError, E:
|
||||||
missing_deps = E
|
missing_deps = E
|
||||||
|
|
||||||
feedName = "example-list.xml"
|
feedName = "example-list.xml"
|
||||||
feedPath = "http://openlayers.org/dev/examples/"
|
feedPath = "http://openlayers.org/dev/examples/"
|
||||||
|
|
||||||
def getListOfOnlineExamples(baseUrl):
|
def getListOfOnlineExamples(baseUrl):
|
||||||
"""
|
"""
|
||||||
useful if you want to get a list of examples a url. not used by default.
|
useful if you want to get a list of examples a url. not used by default.
|
||||||
"""
|
"""
|
||||||
html = urllib2.urlopen(baseUrl)
|
html = urllib2.urlopen(baseUrl)
|
||||||
soup = BeautifulSoup(html)
|
soup = BeautifulSoup(html)
|
||||||
examples = soup.findAll('li')
|
examples = soup.findAll('li')
|
||||||
examples = [example.find('a').get('href') for example in examples]
|
examples = [example.find('a').get('href') for example in examples]
|
||||||
examples = [example for example in examples if example.endswith('.html')]
|
examples = [example for example in examples if example.endswith('.html')]
|
||||||
examples = [example for example in examples]
|
examples = [example for example in examples]
|
||||||
return examples
|
return examples
|
||||||
|
|
||||||
def getListOfExamples(relPath):
|
def getListOfExamples(relPath):
|
||||||
"""
|
"""
|
||||||
returns list of .html filenames within a given path - excludes example-list.html
|
returns list of .html filenames within a given path - excludes example-list.html
|
||||||
"""
|
"""
|
||||||
examples = os.listdir(relPath)
|
examples = os.listdir(relPath)
|
||||||
examples = [example for example in examples if example.endswith('.html') and example != "example-list.html"]
|
examples = [example for example in examples if example.endswith('.html') and example != "example-list.html"]
|
||||||
return examples
|
return examples
|
||||||
|
|
||||||
|
|
||||||
def getExampleHtml(location):
|
def getExampleHtml(location):
|
||||||
"""
|
"""
|
||||||
returns html of a specific example that is available online or locally
|
returns html of a specific example that is available online or locally
|
||||||
"""
|
"""
|
||||||
print '.',
|
print '.',
|
||||||
if location.startswith('http'):
|
if location.startswith('http'):
|
||||||
return urllib2.urlopen(location).read()
|
return urllib2.urlopen(location).read()
|
||||||
else:
|
else:
|
||||||
f = open(location)
|
f = open(location)
|
||||||
html = f.read()
|
html = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
def extractById(soup, tagId, value=None):
|
def extractById(soup, tagId, value=None):
|
||||||
"""
|
"""
|
||||||
returns full contents of a particular tag id
|
returns full contents of a particular tag id
|
||||||
"""
|
"""
|
||||||
beautifulTag = soup.find(id=tagId)
|
beautifulTag = soup.find(id=tagId)
|
||||||
if beautifulTag:
|
if beautifulTag:
|
||||||
if beautifulTag.contents:
|
if beautifulTag.contents:
|
||||||
value = str(beautifulTag.renderContents()).strip()
|
value = str(beautifulTag.renderContents()).strip()
|
||||||
value = value.replace('\t','')
|
value = value.replace('\t','')
|
||||||
value = value.replace('\n','')
|
value = value.replace('\n','')
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def getRelatedClasses(html):
|
def getRelatedClasses(html):
|
||||||
"""
|
"""
|
||||||
parses the html, and returns a list of all OpenLayers Classes
|
parses the html, and returns a list of all OpenLayers Classes
|
||||||
used within (ie what parts of OL the javascript uses).
|
used within (ie what parts of OL the javascript uses).
|
||||||
"""
|
"""
|
||||||
rawstr = r'''(?P<class>OpenLayers\..*?)\('''
|
rawstr = r'''(?P<class>OpenLayers\..*?)\('''
|
||||||
return re.findall(rawstr, html)
|
return re.findall(rawstr, html)
|
||||||
|
|
||||||
def parseHtml(html,ids):
|
def parseHtml(html,ids):
|
||||||
"""
|
"""
|
||||||
returns dictionary of items of interest
|
returns dictionary of items of interest
|
||||||
"""
|
"""
|
||||||
soup = BeautifulSoup(html)
|
soup = BeautifulSoup(html)
|
||||||
d = {}
|
d = {}
|
||||||
for tagId in ids:
|
for tagId in ids:
|
||||||
d[tagId] = extractById(soup,tagId)
|
d[tagId] = extractById(soup,tagId)
|
||||||
#classes should eventually be parsed from docs - not automatically created.
|
#classes should eventually be parsed from docs - not automatically created.
|
||||||
classes = getRelatedClasses(html)
|
classes = getRelatedClasses(html)
|
||||||
d['classes'] = classes
|
d['classes'] = classes
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def getSvnInfo(path):
|
def getSvnInfo(path):
|
||||||
h = os.popen("svn info %s --xml" % path)
|
h = os.popen("svn info %s --xml" % path)
|
||||||
tree = ElementTree.fromstring(h.read())
|
tree = ElementTree.fromstring(h.read())
|
||||||
h.close()
|
h.close()
|
||||||
d = {
|
d = {
|
||||||
'url': tree.findtext('entry/url'),
|
'url': tree.findtext('entry/url'),
|
||||||
'author': tree.findtext('entry/commit/author'),
|
'author': tree.findtext('entry/commit/author'),
|
||||||
'date': tree.findtext('entry/commit/date')
|
'date': tree.findtext('entry/commit/date')
|
||||||
}
|
}
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def createFeed(examples):
|
def createFeed(examples):
|
||||||
doc = Document()
|
doc = Document()
|
||||||
atomuri = "http://www.w3.org/2005/Atom"
|
atomuri = "http://www.w3.org/2005/Atom"
|
||||||
feed = doc.createElementNS(atomuri, "feed")
|
feed = doc.createElementNS(atomuri, "feed")
|
||||||
feed.setAttribute("xmlns", atomuri)
|
feed.setAttribute("xmlns", atomuri)
|
||||||
title = doc.createElementNS(atomuri, "title")
|
title = doc.createElementNS(atomuri, "title")
|
||||||
title.appendChild(doc.createTextNode("OpenLayers Examples"))
|
title.appendChild(doc.createTextNode("OpenLayers Examples"))
|
||||||
feed.appendChild(title)
|
feed.appendChild(title)
|
||||||
link = doc.createElementNS(atomuri, "link")
|
link = doc.createElementNS(atomuri, "link")
|
||||||
link.setAttribute("rel", "self")
|
link.setAttribute("rel", "self")
|
||||||
link.setAttribute("href", feedPath + feedName)
|
link.setAttribute("href", feedPath + feedName)
|
||||||
|
|
||||||
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
|
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
|
||||||
id = doc.createElementNS(atomuri, "id")
|
id = doc.createElementNS(atomuri, "id")
|
||||||
id.appendChild(doc.createTextNode("%s%s#%s" % (feedPath, feedName, modtime)))
|
id.appendChild(doc.createTextNode("%s%s#%s" % (feedPath, feedName, modtime)))
|
||||||
feed.appendChild(id)
|
feed.appendChild(id)
|
||||||
|
|
||||||
updated = doc.createElementNS(atomuri, "updated")
|
updated = doc.createElementNS(atomuri, "updated")
|
||||||
updated.appendChild(doc.createTextNode(modtime))
|
updated.appendChild(doc.createTextNode(modtime))
|
||||||
feed.appendChild(updated)
|
feed.appendChild(updated)
|
||||||
|
|
||||||
examples.sort(key=lambda x:x["modified"])
|
examples.sort(key=lambda x:x["modified"])
|
||||||
for example in sorted(examples, key=lambda x:x["modified"], reverse=True):
|
for example in sorted(examples, key=lambda x:x["modified"], reverse=True):
|
||||||
entry = doc.createElementNS(atomuri, "entry")
|
entry = doc.createElementNS(atomuri, "entry")
|
||||||
|
|
||||||
title = doc.createElementNS(atomuri, "title")
|
title = doc.createElementNS(atomuri, "title")
|
||||||
title.appendChild(doc.createTextNode(example["title"] or example["example"]))
|
title.appendChild(doc.createTextNode(example["title"] or example["example"]))
|
||||||
entry.appendChild(title)
|
entry.appendChild(title)
|
||||||
|
|
||||||
link = doc.createElementNS(atomuri, "link")
|
link = doc.createElementNS(atomuri, "link")
|
||||||
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
|
link.setAttribute("href", "%s%s" % (feedPath, example["example"]))
|
||||||
entry.appendChild(link)
|
entry.appendChild(link)
|
||||||
|
|
||||||
summary = doc.createElementNS(atomuri, "summary")
|
summary = doc.createElementNS(atomuri, "summary")
|
||||||
summary.appendChild(doc.createTextNode(example["shortdesc"] or example["example"]))
|
summary.appendChild(doc.createTextNode(example["shortdesc"] or example["example"]))
|
||||||
entry.appendChild(summary)
|
entry.appendChild(summary)
|
||||||
|
|
||||||
updated = doc.createElementNS(atomuri, "updated")
|
updated = doc.createElementNS(atomuri, "updated")
|
||||||
updated.appendChild(doc.createTextNode(example["modified"]))
|
updated.appendChild(doc.createTextNode(example["modified"]))
|
||||||
entry.appendChild(updated)
|
entry.appendChild(updated)
|
||||||
|
|
||||||
author = doc.createElementNS(atomuri, "author")
|
author = doc.createElementNS(atomuri, "author")
|
||||||
name = doc.createElementNS(atomuri, "name")
|
name = doc.createElementNS(atomuri, "name")
|
||||||
name.appendChild(doc.createTextNode(example["author"]))
|
name.appendChild(doc.createTextNode(example["author"]))
|
||||||
author.appendChild(name)
|
author.appendChild(name)
|
||||||
entry.appendChild(author)
|
entry.appendChild(author)
|
||||||
|
|
||||||
id = doc.createElementNS(atomuri, "id")
|
id = doc.createElementNS(atomuri, "id")
|
||||||
id.appendChild(doc.createTextNode("%s%s#%s" % (feedPath, example["example"], example["modified"])))
|
id.appendChild(doc.createTextNode("%s%s#%s" % (feedPath, example["example"], example["modified"])))
|
||||||
entry.appendChild(id)
|
entry.appendChild(id)
|
||||||
|
|
||||||
feed.appendChild(entry)
|
feed.appendChild(entry)
|
||||||
|
|
||||||
doc.appendChild(feed)
|
doc.appendChild(feed)
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
def wordIndex(examples):
|
def wordIndex(examples):
|
||||||
"""
|
"""
|
||||||
Create an inverted index based on words in title and shortdesc. Keys are
|
Create an inverted index based on words in title and shortdesc. Keys are
|
||||||
lower cased words. Values are dictionaries with example index keys and
|
lower cased words. Values are dictionaries with example index keys and
|
||||||
count values.
|
count values.
|
||||||
"""
|
"""
|
||||||
index = {}
|
index = {}
|
||||||
unword = re.compile("\\W+")
|
unword = re.compile("\\W+")
|
||||||
keys = ["shortdesc", "title"]
|
keys = ["shortdesc", "title"]
|
||||||
for i in range(len(examples)):
|
for i in range(len(examples)):
|
||||||
for key in keys:
|
for key in keys:
|
||||||
text = examples[i][key]
|
text = examples[i][key]
|
||||||
if text:
|
if text:
|
||||||
words = unword.split(text)
|
words = unword.split(text)
|
||||||
for word in words:
|
for word in words:
|
||||||
if word:
|
if word:
|
||||||
word = word.lower()
|
word = word.lower()
|
||||||
if index.has_key(word):
|
if index.has_key(word):
|
||||||
if index[word].has_key(i):
|
if index[word].has_key(i):
|
||||||
index[word][i] += 1
|
index[word][i] += 1
|
||||||
else:
|
else:
|
||||||
index[word][i] = 1
|
index[word][i] = 1
|
||||||
else:
|
else:
|
||||||
index[word] = {i: 1}
|
index[word] = {i: 1}
|
||||||
return index
|
return index
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
if missing_deps:
|
if missing_deps:
|
||||||
print "This script requires simplejson and BeautifulSoup. You don't have them. \n(%s)" % E
|
print "This script requires simplejson and BeautifulSoup. You don't have them. \n(%s)" % E
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
if len(sys.argv) > 1:
|
if len(sys.argv) > 1:
|
||||||
outFile = open(sys.argv[1],'w')
|
outFile = open(sys.argv[1],'w')
|
||||||
else:
|
else:
|
||||||
outFile = open('../examples/example-list.js','w')
|
outFile = open('../examples/example-list.js','w')
|
||||||
|
|
||||||
examplesLocation = '../examples'
|
examplesLocation = '../examples'
|
||||||
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
|
print 'Reading examples from %s and writing out to %s' % (examplesLocation, outFile.name)
|
||||||
|
|
||||||
exampleList = []
|
exampleList = []
|
||||||
docIds = ['title','shortdesc']
|
docIds = ['title','shortdesc']
|
||||||
|
|
||||||
#comment out option to create docs from online resource
|
#comment out option to create docs from online resource
|
||||||
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'
|
#examplesLocation = 'http://svn.openlayers.org/sandbox/docs/examples/'
|
||||||
#examples = getListOfOnlineExamples(examplesLocation)
|
#examples = getListOfOnlineExamples(examplesLocation)
|
||||||
|
|
||||||
examples = getListOfExamples(examplesLocation)
|
examples = getListOfExamples(examplesLocation)
|
||||||
|
|
||||||
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
|
modtime = time.strftime("%Y-%m-%dT%I:%M:%SZ", time.gmtime())
|
||||||
|
|
||||||
for example in examples:
|
for example in examples:
|
||||||
url = os.path.join(examplesLocation,example)
|
url = os.path.join(examplesLocation,example)
|
||||||
html = getExampleHtml(url)
|
html = getExampleHtml(url)
|
||||||
tagvalues = parseHtml(html,docIds)
|
tagvalues = parseHtml(html,docIds)
|
||||||
tagvalues['example'] = example
|
tagvalues['example'] = example
|
||||||
# add in svn info
|
# add in svn info
|
||||||
d = getSvnInfo(url)
|
d = getSvnInfo(url)
|
||||||
tagvalues["modified"] = d["date"] or modtime
|
tagvalues["modified"] = d["date"] or modtime
|
||||||
tagvalues["author"] = d["author"] or "anonymous"
|
tagvalues["author"] = d["author"] or "anonymous"
|
||||||
tagvalues['link'] = example
|
tagvalues['link'] = example
|
||||||
|
|
||||||
exampleList.append(tagvalues)
|
exampleList.append(tagvalues)
|
||||||
|
|
||||||
print
|
print
|
||||||
|
|
||||||
exampleList.sort(key=lambda x:x['example'].lower())
|
exampleList.sort(key=lambda x:x['example'].lower())
|
||||||
|
|
||||||
index = wordIndex(exampleList)
|
index = wordIndex(exampleList)
|
||||||
|
|
||||||
json = simplejson.dumps({"examples": exampleList, "index": index})
|
json = simplejson.dumps({"examples": exampleList, "index": index})
|
||||||
#give the json a global variable we can use in our js. This should be replaced or made optional.
|
#give the json a global variable we can use in our js. This should be replaced or made optional.
|
||||||
json = 'var info=' + json
|
json = 'var info=' + json
|
||||||
outFile.write(json)
|
outFile.write(json)
|
||||||
outFile.close()
|
outFile.close()
|
||||||
|
|
||||||
print "writing feed to ../examples/%s " % feedName
|
print "writing feed to ../examples/%s " % feedName
|
||||||
atom = open('../examples/%s' % feedName, 'w')
|
atom = open('../examples/%s' % feedName, 'w')
|
||||||
doc = createFeed(exampleList)
|
doc = createFeed(exampleList)
|
||||||
atom.write(doc.toxml())
|
atom.write(doc.toxml())
|
||||||
atom.close()
|
atom.close()
|
||||||
|
|
||||||
|
|
||||||
print 'complete'
|
print 'complete'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user