[Commits] r2163 - in sandbox/camptocamp/extensions/geoext.ux/ux: . DisplayProjectionSelectorCombo/examples DisplayProjectionSelectorCombo/tests/lib/GeoExt.ux OpenAddressesSearchCombo/examples OpenAddressesSearchCombo/lib OpenAddressesSearchCombo/lib/GeoExt.ux OpenAddressesSearchCombo/tests/lib/GeoExt.ux ScaleSelectorCombo ScaleSelectorCombo/examples ScaleSelectorCombo/lib ScaleSelectorCombo/lib/GeoExt.ux ScaleSelectorCombo/tests ScaleSelectorCombo/tests/lib ScaleSelectorCombo/tests/lib/GeoExt.ux
commits at geoext.org
commits at geoext.org
Thu May 6 16:22:27 CEST 2010
Author: aabt
Date: 2010-05-06 16:22:27 +0200 (Thu, 06 May 2010)
New Revision: 2163
Added:
sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/lib/GeoExt.ux/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.html
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/lib/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/lib/GeoExt.ux/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/lib/GeoExt.ux/ScaleSelectorCombo.js
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/index.html
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/lib/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/lib/GeoExt.ux/
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/lib/GeoExt.ux/ScaleSelectorCombo.html
sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/list-tests.html
Removed:
sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/lib/GeoExt.ux.openaddresses/
Modified:
sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/examples/DisplayProjectionSelectorComboExample.html
sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/tests/lib/GeoExt.ux/DisplayProjectionSelectorCombo.html
sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/examples/OpenAddressesSearchComboExample.html
sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/tests/lib/GeoExt.ux/OpenAddressesSearchCombo.html
Log:
[sandbox/camptocamp] Add ScaleSelectorCombo ux, and unify tests and examples path to libs to local files
Modified: sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/examples/DisplayProjectionSelectorComboExample.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/examples/DisplayProjectionSelectorComboExample.html 2010-05-06 08:22:04 UTC (rev 2162)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/examples/DisplayProjectionSelectorComboExample.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -2,9 +2,10 @@
<head>
<title>Display Projection Selector Example</title>
- <script type="text/javascript" src="http://extjs.cachefly.net/builds/ext-cdn-771.js"></script>
- <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/resources/css/ext-all.css"/>
- <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-2.2.1/examples/shared/examples.css"/>
+ <script type="text/javascript" src="../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../ext/ext-all.js"></script>
+ <link rel="stylesheet" type="text/css" href="../../../../ext/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../../../../ext/examples/shared/examples.css" />
<script type="text/javascript" src="../../../../openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript" src="../../../../geoext/lib/GeoExt.js"></script>
<script type="text/javascript" src="proj4js/lib/proj4js.js"></script>
Modified: sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/tests/lib/GeoExt.ux/DisplayProjectionSelectorCombo.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/tests/lib/GeoExt.ux/DisplayProjectionSelectorCombo.html 2010-05-06 08:22:04 UTC (rev 2162)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/DisplayProjectionSelectorCombo/tests/lib/GeoExt.ux/DisplayProjectionSelectorCombo.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -2,10 +2,10 @@
<html debug="true">
<head>
- <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/adapter/ext/ext-base.js"></script>
- <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/ext-all.js"></script>
- <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/resources/css/ext-all.css" />
- <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/examples/shared/examples.css" />
+ <script type="text/javascript" src="../../../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../../../ext/ext-all.js"></script>
+ <link rel="stylesheet" type="text/css" href="../../../../../../ext/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../../../../../../ext/examples/shared/examples.css" />
<script type="text/javascript" src="../../../../../../openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript" src="../../../../../../geoext/lib/GeoExt.js"></script>
<script type="text/javascript" src="../../../examples/proj4js/lib/proj4js.js"></script>
@@ -20,7 +20,7 @@
var c;
- var map = new OpenLayers.Map();
+ var map = new OpenLayers.Map('map');
var layer = new OpenLayers.Layer.OSM("OSM");
map.addLayer(layer);
@@ -39,11 +39,13 @@
t.ok(c.hasListener("displayprojectionchanged"),
"ctor registers a \"displayprojectionchanged\" listener");
c.destroy();
+ map.destroy();
}
</script>
<body>
<div id="DisplayProjectionSelector"></div>
+ <div id="map"></div>
</body>
</html>
Modified: sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/examples/OpenAddressesSearchComboExample.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/examples/OpenAddressesSearchComboExample.html 2010-05-06 08:22:04 UTC (rev 2162)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/examples/OpenAddressesSearchComboExample.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -3,13 +3,13 @@
<title>GeoExt OpenAddresses Search Combo Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/adapter/ext/ext-base.js"></script>
- <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/ext-all.js"></script>
- <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/resources/css/ext-all.css" />
- <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/examples/shared/examples.css" />
+ <script type="text/javascript" src="../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../ext/ext-all.js"></script>
+ <link rel="stylesheet" type="text/css" href="../../../../ext/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../../../../ext/examples/shared/examples.css" />
<script type="text/javascript" src="../../../../openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript" src="../../../../geoext/lib/GeoExt.js"></script>
- <script type="text/javascript" src="../lib/GeoExt.ux.openaddresses/OpenAddressesSearchCombo.js"></script>
+ <script type="text/javascript" src="../lib/GeoExt.ux/OpenAddressesSearchCombo.js"></script>
<script type="text/javascript" src="OpenAddressesSearchComboExample.js"></script>
</head>
Copied: sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/lib/GeoExt.ux (from rev 2162, sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/lib/GeoExt.ux.openaddresses)
Property changes on: sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/lib/GeoExt.ux
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/tests/lib/GeoExt.ux/OpenAddressesSearchCombo.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/tests/lib/GeoExt.ux/OpenAddressesSearchCombo.html 2010-05-06 08:22:04 UTC (rev 2162)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/OpenAddressesSearchCombo/tests/lib/GeoExt.ux/OpenAddressesSearchCombo.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -2,13 +2,13 @@
<html debug="true">
<head>
- <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/adapter/ext/ext-base.js"></script>
- <script type="text/javascript" src="http://svn.geoext.org/ext/3.1.0/ext-all.js"></script>
- <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/resources/css/ext-all.css" />
- <link rel="stylesheet" type="text/css" href="http://svn.geoext.org/ext/3.1.0/examples/shared/examples.css" />
+ <script type="text/javascript" src="../../../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../../../ext/ext-all.js"></script>
+ <link rel="stylesheet" type="text/css" href="../../../../../../ext/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../../../../../../ext/examples/shared/examples.css" />
<script type="text/javascript" src="../../../../../../openlayers/lib/OpenLayers.js"></script>
<script type="text/javascript" src="../../../../../../geoext/lib/GeoExt.js"></script>
- <script type="text/javascript" src="../../../lib/GeoExt.ux.openaddresses/OpenAddressesSearchCombo.js"></script>
+ <script type="text/javascript" src="../../../lib/GeoExt.ux/OpenAddressesSearchCombo.js"></script>
<script type="text/javascript">
function test_ctor(t) {
Added: sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.html (rev 0)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -0,0 +1,24 @@
+<html>
+ <head>
+ <title>GeoExt Scale Selector Example</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <script type="text/javascript" src="../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../ext/ext-all.js"></script>
+ <link rel="stylesheet" type="text/css" href="../../../../ext/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../../../../ext/examples/shared/examples.css" />
+ <script type="text/javascript" src="../../../../openlayers/lib/OpenLayers.js"></script>
+ <script type="text/javascript" src="../../../../geoext/lib/GeoExt.js"></script>
+ <script type="text/javascript" src="../lib/GeoExt.ux/ScaleSelectorCombo.js"></script>
+ <script type="text/javascript" src="ScaleSelectorComboExample.js"></script>
+
+ </head>
+ <body>
+ <h1>Scale selector</h1>
+ <p>This example demonstrates the scale selector combo.<p>
+ <p>The js is not minified so it is readable. See <a href="ScaleSelectorComboExample.js">ScaleSelectorComboExample.js</a>.</p>
+ <div id="mappanel"></div>
+ <h2>Scale selector in a div</h2>
+ <div id="ScaleSelector"></div>
+ </body>
+</html>
Added: sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js (rev 0)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/examples/ScaleSelectorComboExample.js 2010-05-06 14:22:27 UTC (rev 2163)
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+/** api: example[ScaleSelectorCombo]
+ * Scale Selector Combo
+ * ---------------------
+ * Combo select a scale
+ */
+
+var mapPanel;
+
+Ext.onReady(function() {
+ var map = new OpenLayers.Map();
+ var layer = new OpenLayers.Layer.OSM("OSM");
+ map.addLayer(layer);
+
+ map.addControl(new OpenLayers.Control.MousePosition());
+
+ var scaleSelectorCombo = new GeoExt.ux.form.ScaleSelectorCombo({
+ map: map,
+ fakeScaleValue: ['1000','1500','2500','5000','10000','25000','50000','100000','200000','450000','850000','1500000','2500000','5000000','10000000','5000000','100000000','200000000','400000000',]
+ });
+
+ new GeoExt.ux.form.ScaleSelectorCombo({
+ map: map,
+ renderTo: 'ScaleSelector',
+ thousandSeparator: ',',
+ decimalNumber: 4
+ });
+
+ mapPanel = new GeoExt.MapPanel({
+ title: "GeoExt MapPanel with Scale Selector",
+ renderTo: "mappanel",
+ height: 400,
+ width: 600,
+ map: map,
+ tbar: [scaleSelectorCombo]
+ });
+});
\ No newline at end of file
Added: sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/lib/GeoExt.ux/ScaleSelectorCombo.js
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/lib/GeoExt.ux/ScaleSelectorCombo.js (rev 0)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/lib/GeoExt.ux/ScaleSelectorCombo.js 2010-05-06 14:22:27 UTC (rev 2163)
@@ -0,0 +1,177 @@
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
+ * Published under the BSD license.
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
+ * of the license.
+ */
+
+/** api: (define)
+ * module = GeoExt.ux
+ * class = ScaleSelectorCombo
+ * base_link = `Ext.form.ComboBox <http://extjs.com/deploy/dev/docs/?class=Ext.form.ComboBox>`_
+ */
+
+/**
+ * @include GeoExt/data/ScaleStore.js
+ */
+
+Ext.namespace("GeoExt.ux.form");
+
+GeoExt.ux.form.ScaleSelectorCombo = Ext.extend(Ext.form.ComboBox, {
+ /** api: config[map]
+ * ``OpenLayers.Map or Object`` A configured map or a configuration object
+ * for the map constructor, required only if :attr:`zoom` is set to
+ * value greater than or equal to 0.
+ */
+ /** private: property[map]
+ * ``OpenLayers.Map`` The map object.
+ */
+ map: null,
+
+ /** private: property[tpl]
+ * ``Ext.XTemplate`` Template of the combo box content
+ */
+ tpl: '<tpl for="."><div class="x-combo-list-item">1 : {[values.formattedScale]} </div></tpl>',
+
+ /** private: property[editable]
+ * Default: false
+ */
+ editable: false,
+
+ /** private: property[triggerAction]
+ * Needed so that the combo box doesn't filter by its current content. Default: all
+ */
+ triggerAction: 'all',
+
+ /** private: property[mode]
+ * keep the combo box from forcing a lot of unneeded data refreshes. Default: local
+ */
+ mode: 'local',
+
+ /** api: config[thousandSeparator]
+ * The thousand separator string for the scale. Default: '
+ */
+ /** private: property[thousandSeparator]
+ * Thousand separator
+ */
+ thousandSeparator: '\'',
+
+ /** api: config[decimalNumber]
+ * Number of decimal number for the scale. Default: 0
+ */
+ /** private: property[decimalNumber]
+ * Number of decimal number for the scale. Default: 0
+ */
+ decimalNumber: 0,
+
+ /** api: config[fakeScaleValue]
+ * Array of fake scale value
+ */
+ /** private: property[fakeScaleValue]
+ * Array of fake scale value
+ */
+ fakeScaleValue: null,
+
+ /** private: constructor
+ */
+ initComponent: function() {
+ GeoExt.ux.form.ScaleSelectorCombo.superclass.initComponent.apply(this, arguments);
+
+ this.store = new GeoExt.data.ScaleStore({map: this.map});
+
+ if (this.getLocalDecimalSeparator() == this.thousandSeparator) {
+ this.thousandSeparator = '\'';
+ }
+
+ for (var i = 0; i < this.store.getCount(); i++) {
+ if (this.fakeScaleValue) {
+ this.store.getAt(i).data.formattedScale = this.addThousandSeparator(this.roundNumber(this.fakeScaleValue[i], this.decimalNumber), this.thousandSeparator);
+ } else {
+ this.store.getAt(i).data.formattedScale = this.addThousandSeparator(this.roundNumber(this.store.getAt(i).data.scale, this.decimalNumber), this.thousandSeparator);
+ }
+ }
+ this.on('select',
+ function(combo, record, index) {
+ this.map.zoomTo(record.data.level);
+ },
+ this
+ );
+
+ this.map.events.register('zoomend', this, this.zoomendUpdate);
+ this.map.events.triggerEvent("zoomend");
+ },
+
+ /** method[zoomendUpdate]
+ * Method reacting to the map zoomend event in order to update the combo
+ * :param record: the selected record
+ */
+ zoomendUpdate: function(record) {
+ var scale = this.store.queryBy(function(record) {
+ return this.map.getZoom() == record.data.level;
+ });
+ if (scale.length > 0) {
+ scale = scale.items[0];
+ this.setValue("1 : " + scale.data.formattedScale);
+ } else {
+ if (!this.rendered) {
+ return;
+ }
+ this.clearValue();
+ }
+ },
+
+ /** method[addThousandSeparator]
+ * Add the thousand separator to a string
+ * :param value: ``Number`` or ``String`` input value
+ * :param separator: ``String`` thousand separator
+ */
+ addThousandSeparator: function(value, separator) {
+ if (separator === null) {
+ return value;
+ }
+ value = value.toString();
+ var sRegExp = new RegExp('(-?[0-9]+)([0-9]{3})');
+ while (sRegExp.test(value)) {
+ value = value.replace(sRegExp, '$1' + separator + '$2');
+ }
+ // Remove the thousand separator after decimal separator
+ if (this.decimalNumber > 3) {
+ var decimalPosition = value.lastIndexOf(this.getLocalDecimalSeparator());
+ if (decimalPosition > 0) {
+ var postDecimalCharacter = value.substr(decimalPosition);
+ value = value.substr(0, decimalPosition) + postDecimalCharacter.replace(separator, '');
+ }
+ }
+ return value;
+ },
+
+ /** method[roundNumber]
+ * Round number with decimals
+ * :param value: ``Number`` input number
+ * :param decimals: ``Number`` number of decimals place
+ */
+ roundNumber: function(value, decimals) {
+ return Math.round(value * Math.pow(10, decimals)) / Math.pow(10, decimals);
+ },
+
+ /** method[getLocalDecimalSeparator]
+ * Get the local decimal separator
+ */
+ getLocalDecimalSeparator: function() {
+ var n = 1.1;
+ return n.toLocaleString().substring(1, 2);
+ },
+
+ /** private: method[beforeDestroy]
+ *
+ */
+ beforeDestroy: function() {
+ this.map.events.unregister('zoomend', this, this.zoomendUpdate);
+ GeoExt.ux.form.ScaleSelectorCombo.superclass.beforeDestroy.apply(this, arguments);
+ }
+});
+
+
+/** api: xtype = gxux_scaleselectorcombo */
+Ext.reg('gxux_scaleselectorcombo', GeoExt.ux.form.ScaleSelectorCombo);
Added: sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/index.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/index.html (rev 0)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/index.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -0,0 +1,4 @@
+<html>
+ <head><meta http-equiv="refresh" content="0;url=../../../../geoext/tests/run-tests.html?testlist=../../geoext.ux/ux/ScaleSelectorCombo/tests/list-tests.html"></head>
+ <body></body>
+</html>
Added: sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/lib/GeoExt.ux/ScaleSelectorCombo.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/lib/GeoExt.ux/ScaleSelectorCombo.html (rev 0)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/lib/GeoExt.ux/ScaleSelectorCombo.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html debug="true">
+<head>
+
+ <script type="text/javascript" src="../../../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../../../ext/ext-all.js"></script>
+ <link rel="stylesheet" type="text/css" href="../../../../../../ext/resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../../../../../../ext/examples/shared/examples.css" />
+ <script type="text/javascript" src="../../../../../../openlayers/lib/OpenLayers.js"></script>
+ <script type="text/javascript" src="../../../../../../geoext/lib/GeoExt.js"></script>
+ <script type="text/javascript" src="../../../lib/GeoExt.ux/ScaleSelectorCombo.js"></script>
+
+ <script type="text/javascript">
+ function test_ctor(t) {
+ t.plan(3);
+
+ // set up
+
+ var c;
+
+ var map = new OpenLayers.Map();
+ var layer = new OpenLayers.Layer.OSM("OSM");
+ map.addLayer(layer);
+
+ // test
+
+ c = new GeoExt.ux.form.ScaleSelectorCombo({
+ renderTo: "ScaleSelector",
+ map: map
+ });
+ t.ok(c instanceof GeoExt.ux.form.ScaleSelectorCombo,
+ "ctor creates a GeoExt.ux.form.ScaleSelectorCombo object");
+ t.ok(c instanceof Ext.form.ComboBox,
+ "ctor creates an Ext.form.ComboBox object");
+ t.ok(c.hasListener("select"),
+ "ctor registers a \"select\" listener");
+ c.destroy();
+ }
+ </script>
+<body>
+<div id="ScaleSelector"></div>
+</body>
+</html>
Added: sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/list-tests.html
===================================================================
--- sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/list-tests.html (rev 0)
+++ sandbox/camptocamp/extensions/geoext.ux/ux/ScaleSelectorCombo/tests/list-tests.html 2010-05-06 14:22:27 UTC (rev 2163)
@@ -0,0 +1,3 @@
+<ul id="testlist">
+ <li>../../geoext.ux/ux/ScaleSelectorCombo/tests/lib/GeoExt.ux/ScaleSelectorCombo.html</li>
+</ul>
More information about the Commits
mailing list