[Commits] r1042 - in sandbox/camptocamp/geobretagne: . examples lib lib/GeoExt lib/GeoExt/data lib/GeoExt/widgets lib/GeoExt/widgets/form lib/GeoExt/widgets/tips lib/GeoExt/widgets/tree tests tests/lib/GeoExt/data tests/lib/GeoExt/widgets
commits at geoext.org
commits at geoext.org
Thu Jun 11 11:46:19 CEST 2009
Author: fredj
Date: 2009-06-11 11:46:19 +0200 (Thu, 11 Jun 2009)
New Revision: 1042
Added:
sandbox/camptocamp/geobretagne/examples/zoomslider.html
sandbox/camptocamp/geobretagne/examples/zoomslider.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/ZoomSlider.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js
sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/ZoomSlider.html
Removed:
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js
Modified:
sandbox/camptocamp/geobretagne/examples/feature-grid.js
sandbox/camptocamp/geobretagne/examples/layercontainer.js
sandbox/camptocamp/geobretagne/examples/legendpanel.js
sandbox/camptocamp/geobretagne/examples/mappanel-div.js
sandbox/camptocamp/geobretagne/examples/mappanel-viewport.js
sandbox/camptocamp/geobretagne/examples/mappanel-window.js
sandbox/camptocamp/geobretagne/examples/popup.js
sandbox/camptocamp/geobretagne/examples/search-form.js
sandbox/camptocamp/geobretagne/examples/toolbar.js
sandbox/camptocamp/geobretagne/examples/tree.js
sandbox/camptocamp/geobretagne/examples/wms-capabilities.js
sandbox/camptocamp/geobretagne/examples/zoom-chooser.js
sandbox/camptocamp/geobretagne/lib/GeoExt.js
sandbox/camptocamp/geobretagne/lib/GeoExt/SingleFile.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureReader.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureRecord.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureStore.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerReader.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerRecord.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerStore.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/ProtocolProxy.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/ScaleStore.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js
sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesStore.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Action.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendImage.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendPanel.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendWMS.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/MapPanel.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Popup.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/BasicForm.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/FormPanel.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/SearchAction.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/BaseLayerContainer.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerContainer.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerNode.js
sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/OverlayLayerContainer.js
sandbox/camptocamp/geobretagne/license.txt
sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/ScaleStore.html
sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/Popup.html
sandbox/camptocamp/geobretagne/tests/list-tests.html
Log:
svn merge -r943:HEAD http://svn.geoext.org/core/trunk/geoext .
Modified: sandbox/camptocamp/geobretagne/examples/feature-grid.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/feature-grid.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/feature-grid.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
Ext.BLANK_IMAGE_URL = "../../../../ext/resources/images/default/s.gif"
var mapPanel, store, gridPanel, mainPanel;
Modified: sandbox/camptocamp/geobretagne/examples/layercontainer.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/layercontainer.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/layercontainer.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
var store, tree, panel;
Ext.onReady(function() {
Modified: sandbox/camptocamp/geobretagne/examples/legendpanel.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/legendpanel.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/legendpanel.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,10 @@
+/**
+ * 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.
+ */
var mapPanel;
Modified: sandbox/camptocamp/geobretagne/examples/mappanel-div.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/mappanel-div.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/mappanel-div.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,10 @@
+/**
+ * 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.
+ */
var mapPanel;
Modified: sandbox/camptocamp/geobretagne/examples/mappanel-viewport.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/mappanel-viewport.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/mappanel-viewport.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
var mapPanel;
Ext.onReady(function() {
Modified: sandbox/camptocamp/geobretagne/examples/mappanel-window.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/mappanel-window.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/mappanel-window.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
var mapPanel;
Ext.onReady(function() {
Modified: sandbox/camptocamp/geobretagne/examples/popup.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/popup.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/popup.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
// make the references to the map panel and the popup
// global, this is useful for looking at their states
// from the console
@@ -36,7 +44,7 @@
}
}
});
- mapPanel.add(popup);
+ popup.show();
}
// create popup on "featureselected"
Modified: sandbox/camptocamp/geobretagne/examples/search-form.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/search-form.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/search-form.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,10 @@
+/**
+ * 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.
+ */
var formPanel;
Modified: sandbox/camptocamp/geobretagne/examples/toolbar.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/toolbar.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/toolbar.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,10 @@
+/**
+ * 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.
+ */
Ext.onReady(function() {
var map = new OpenLayers.Map();
Modified: sandbox/camptocamp/geobretagne/examples/tree.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/tree.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/tree.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
var mapPanel;
Ext.onReady(function() {
// using OpenLayers.Format.JSON to create a nice formatted string of the
Modified: sandbox/camptocamp/geobretagne/examples/wms-capabilities.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/wms-capabilities.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/wms-capabilities.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,11 @@
+/**
+ * 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.
+ */
+
var store;
Ext.onReady(function() {
@@ -30,12 +38,12 @@
function mapPreview(grid, index) {
var record = grid.getStore().getAt(index);
var layer = record.get("layer").clone();
- layer.isBaseLayer = true; // default is false
var win = new Ext.Window({
title: "Preview: " + record.get("title"),
width: 512,
height: 256,
+ layout: "fit",
items: [{
xtype: "gx_mappanel",
layers: [layer],
Modified: sandbox/camptocamp/geobretagne/examples/zoom-chooser.js
===================================================================
--- sandbox/camptocamp/geobretagne/examples/zoom-chooser.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/examples/zoom-chooser.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,3 +1,10 @@
+/**
+ * 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.
+ */
var mapPanel;
Copied: sandbox/camptocamp/geobretagne/examples/zoomslider.html (from rev 1041, core/trunk/geoext/examples/zoomslider.html)
===================================================================
--- sandbox/camptocamp/geobretagne/examples/zoomslider.html (rev 0)
+++ sandbox/camptocamp/geobretagne/examples/zoomslider.html 2009-06-11 09:46:19 UTC (rev 1042)
@@ -0,0 +1,22 @@
+<html>
+ <head>
+ <title>GeoExt ZoomSlider</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.com/deploy/dev/examples/shared/examples.css"></link>
+ <script src="http://openlayers.org/api/2.8-rc2/OpenLayers.js"></script>
+ <script type="text/javascript" src="../lib/GeoExt.js"></script>
+
+ <script type="text/javascript" src="zoomslider.js"></script>
+ </head>
+ <body>
+ <h1>GeoExt.ZoomSlider</h1>
+ <p>The ZoomSlider allows control of the map scale using an Ext.Slider.
+ It is also possible to add a special tooltip plugin, ZoomSliderTip, which
+ will show the zoom level, scale and resolution while dragging the slider
+ (the content is configurable).<p>
+ <p>The js is not minified so it is readable. See <a href="zoomslider.js">zoomslider.js</a>.</p>
+ <div id="map-container"></div>
+ </body>
+</html>
Copied: sandbox/camptocamp/geobretagne/examples/zoomslider.js (from rev 1041, core/trunk/geoext/examples/zoomslider.js)
===================================================================
--- sandbox/camptocamp/geobretagne/examples/zoomslider.js (rev 0)
+++ sandbox/camptocamp/geobretagne/examples/zoomslider.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+var panel, slider;
+
+Ext.onReady(function() {
+
+ // create a map panel with an embedded slider
+ panel = new GeoExt.MapPanel({
+ title: "Map",
+ renderTo: "map-container",
+ height: 300,
+ width: 400,
+ map: {
+ controls: [new OpenLayers.Control.Navigation()]
+ },
+ layers: [new OpenLayers.Layer.WMS(
+ "Global Imagery",
+ "http://demo.opengeo.org/geoserver/wms",
+ {layers: 'bluemarble'}
+ )],
+ extent: [-5, 35, 15, 55],
+ items: [{
+ xtype: "gx_zoomslider",
+ vertical: true,
+ height: 100,
+ x: 10,
+ y: 20,
+ plugins: new GeoExt.ZoomSliderTip()
+ }]
+ });
+
+ // create a separate slider bound to the map but displayed elsewhere
+ slider = new GeoExt.ZoomSlider({
+ map: panel.map,
+ width: 200,
+ plugins: new GeoExt.ZoomSliderTip({
+ template: "<div>Zoom Level: {zoom}</div>"
+ }),
+ renderTo: document.body
+ });
+
+});
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/SingleFile.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/SingleFile.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/SingleFile.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,20 +1,9 @@
-/*
- * Copyright (C) 2007-2008 Camptocamp, OpenGeo
- *
- * This file is part of GeoExt
- *
- * GeoExt is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GeoExt is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeoExt. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * 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.
*/
Ext.namespace("GeoExt");
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureReader.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureReader.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureReader.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,20 +1,9 @@
-/*
- * Copyright (C) 2008 Eric Lemoine, Camptocamp France SAS
- *
- * This file is part of GeoExt
- *
- * GeoExt is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GeoExt is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeoExt. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * 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.
*/
/**
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureRecord.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureRecord.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureRecord.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt.data
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureStore.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureStore.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/FeatureStore.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @include GeoExt/data/FeatureReader.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerReader.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerReader.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerReader.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @include GeoExt/data/LayerRecord.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerRecord.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerRecord.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerRecord.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt.data
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerStore.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerStore.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/LayerStore.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @include GeoExt/data/LayerReader.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/ProtocolProxy.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/ProtocolProxy.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/ProtocolProxy.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,20 +1,9 @@
-/*
- * Copyright (C) 2008 Eric Lemoine, Camptocamp France SAS
- *
- * This file is part of GeoExt
- *
- * GeoExt is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GeoExt is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeoExt. If not, see <http://www.gnu.org/licenses/>.
+/**
+ * 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)
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/ScaleStore.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/ScaleStore.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/ScaleStore.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/** api: (define)
* module = GeoExt.data
@@ -48,7 +49,9 @@
GeoExt.data.ScaleStore.superclass.constructor.call(this, config);
- if (map) this.bind(map);
+ if (map) {
+ this.bind(map);
+ }
},
/** api: method[bind]
@@ -103,13 +106,16 @@
*/
populateFromMap: function() {
var zooms = [];
+ var resolutions = this.map.baseLayer.resolutions;
+ var units = this.map.baseLayer.units;
- for (var i = this.map.numZoomLevels-1; i > 0; i--) {
- var res = this.map.getResolutionForZoom(i);
- var units = this.map.baseLayer.units;
- var scale = OpenLayers.Util.getScaleFromResolution(res, units);
-
- zooms.push({level: i, resolution: res, scale: scale});
+ for (var i=resolutions.length-1; i >= 0; i--) {
+ var res = resolutions[i];
+ zooms.push({
+ level: i,
+ resolution: res,
+ scale: OpenLayers.Util.getScaleFromResolution(res, units)
+ });
}
this.loadData(zooms);
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesReader.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,7 +1,15 @@
/**
- * Copyright (c) 2008 The Open Planning Project
+ * 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.
*/
+/**
+ * @include GeoExt/data/LayerRecord.js
+ */
+
/** api: (define)
* module = GeoExt.data
* class = WMSCapabilitiesReader
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesStore.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesStore.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/data/WMSCapabilitiesStore.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,5 +1,9 @@
/**
- * Copyright (c) 2008 The Open Planning Project
+ * 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.
*/
/**
@@ -40,6 +44,7 @@
*/
GeoExt.data.WMSCapabilitiesStore = function(c) {
+ c = c || {};
GeoExt.data.WMSCapabilitiesStore.superclass.constructor.call(
this,
Ext.apply(c, {
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Action.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Action.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Action.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendImage.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendImage.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendImage.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,13 +1,15 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt
* class = LegendImage
+ * base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
*/
Ext.namespace('GeoExt');
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendPanel.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendPanel.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendPanel.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,13 +1,15 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt
* class = LegendPanel
+ * base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
*/
Ext.namespace('GeoExt');
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendWMS.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendWMS.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/LegendWMS.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/**
* @include GeoExt/widgets/LegendImage.js
@@ -12,6 +13,7 @@
/** api: (define)
* module = GeoExt
* class = LegendWMS
+ * base_link = `Ext.Panel <http://extjs.com/deploy/dev/docs/?class=Ext.Panel>`_
*/
Ext.namespace('GeoExt');
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/MapPanel.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/MapPanel.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/MapPanel.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @include GeoExt/data/LayerStore.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Popup.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Popup.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/Popup.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,9 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation [1]
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * [1] pending approval
*/
/** api: (define)
@@ -44,6 +44,14 @@
*/
anchored: true,
+ /** api: config[map]
+ * ``OpenLayers.Map`` or :class:`GeoExt.MapPanel`
+ * The map this popup will be anchored to (only required if ``anchored``
+ * is set to true and the map cannot be derived from the ``feature``'s
+ * layer.
+ */
+ map: null,
+
/** api: config[panIn]
* ``Boolean`` The popup should pan the map so that the popup is
* fully in view when it is rendered. Default is ``true``.
@@ -108,10 +116,19 @@
/** private: method[initComponent]
* Initializes the popup.
*/
- initComponent: function() {
+ initComponent: function() {
+ if(this.map instanceof GeoExt.MapPanel) {
+ this.map = this.map.map;
+ }
+ if(!this.map && this.feature && this.feature.layer) {
+ this.map = this.feature.layer.map;
+ }
if (!this.feature && this.lonlat) {
this.feature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(this.lonlat.lon, this.lonlat.lat));
}
+ if(this.anchored) {
+ this.addAnchorEvents();
+ }
this.baseCls = this.popupCls + " " + this.baseCls;
@@ -146,38 +163,19 @@
GeoExt.Popup.superclass.initTools.call(this);
},
- /** private: method[addToMapPanel]
- * :param mapPanel: :class:`MapPanel` The panel to which this popup should
- * be added.
- *
- * Adds this popup to a :class:`MapPanel`. Assumes that the
- * MapPanel's map is already initialized and that the
- * Popup's feature is on the map. This method is called by the MapPanel's
- * add method.
+ /** private: method[show]
+ * Override.
*/
- addToMapPanel: function(mapPanel) {
- this.mapPanel = mapPanel;
- this.map = this.mapPanel.map;
-
- mapPanel.on({
- "add": {
- fn: function() {
- mapPanel.doLayout();
- this.position();
- if(this.anchored) {
- this.anchorPopup();
- }
- this.show();
- if(this.panIn) {
- this.panIntoView();
- }
- },
- single: true,
- scope: this
+ show: function() {
+ GeoExt.Popup.superclass.show.apply(this, arguments);
+ if(this.anchored) {
+ this.position();
+ if(this.panIn && !this._mapmove) {
+ this.panIntoView();
}
- });
+ }
},
-
+
/** api: method[setSize]
* :param w: ``Integer``
* :param h: ``Integer``
@@ -202,21 +200,32 @@
*/
position: function() {
var centerLonLat = this.feature.geometry.getBounds().getCenterLonLat();
- var centerPx = this.map.getViewPortPxFromLonLat(centerLonLat);
- //This works for positioning with the anchor on the bottom.
-
- //Will have to functionalize this out later and allow
- //for other positions relative to the feature.
- var anchorSelector = "div." + this.ancCls;
+ if(this._mapMove === true) {
+ var visible = this.map.getExtent().containsLonLat(centerLonLat);
+ if(visible !== this.isVisible()) {
+ this.setVisible(visible);
+ }
+ }
- var dx = this.anc.down(anchorSelector).getLeft(true) +
- this.anc.down(anchorSelector).getWidth() / 2;
- var dy = this.el.getHeight();
-
- //Assuming for now that the map viewport takes up
- //the entire area of the MapPanel
- this.setPosition(centerPx.x - dx, centerPx.y - dy);
+ if(this.isVisible()) {
+ var centerPx = this.map.getViewPortPxFromLonLat(centerLonLat);
+ var mapBox = Ext.fly(this.map.div).getBox();
+
+ //This works for positioning with the anchor on the bottom.
+
+ //Will have to functionalize this out later and allow
+ //for other positions relative to the feature.
+ var anchorSelector = "div." + this.ancCls;
+
+ var dx = this.anc.down(anchorSelector).getLeft(true) +
+ this.anc.down(anchorSelector).getWidth() / 2;
+ var dy = this.el.getHeight();
+
+ //Assuming for now that the map viewport takes up
+ //the entire area of the MapPanel
+ this.setPosition(centerPx.x + mapBox.x - dx, centerPx.y + mapBox.y - dy);
+ }
},
/** private: method[getAnchorElement]
@@ -228,30 +237,13 @@
return anc;
},
- /** private: method[anchorPopup]
- * Anchors a popup to its feature by registering listeners that reposition
- * the popup when the map is moved.
- */
- anchorPopup: function() {
- this.map.events.on({
- "move" : this.position,
- scope : this
- });
-
- this.on({
- "resize": this.position,
- "collapse": this.position,
- "expand": this.position,
- scope: this
- });
- },
-
/** private: method[unanchorPopup]
* Unanchors a popup from its feature. This removes the popup from its
* MapPanel and adds it to the page body.
*/
unanchorPopup: function() {
-
+ this.removeAnchorEvents();
+
//make the window draggable
this.draggable = true;
this.header.addClass("x-window-draggable");
@@ -263,70 +255,24 @@
//hide unpin tool
this.tools.unpin.hide();
-
- //keep track of whether the popup has been collapsed
- var collapsed = this.collapsed;
-
- //Steps to move this window out to the body
- //TODO: Make 'unpinned' container configurable
- this.mapPanel.remove(this, false);
-
- this.container = Ext.getBody();
-
- var xy = this.getPosition();
- this.hide();
- this.el.appendTo(Ext.getBody());
- this.setPagePosition(xy[0],xy[1]);
- this.show();
-
- //recollapse if it was collapsed before
- if(collapsed) {
- this.collapse();
- }
},
- /** private: method[removeFromMapPanel]
- * Utility method for unbinding events that call for popup repositioning.
- * Called from the panel during panel.remove(popup).
- */
- removeFromMapPanel: function() {
- if(this.map && this.map.events) {
- //stop position with feature
- this.map.events.un({
- "move" : this.position,
- scope : this
- });
- }
-
- this.un("resize", this.position, this);
- this.un("collapse", this.position, this);
- this.un("expand", this.position, this);
-
- delete this.mapPanel;
- delete this.map;
- },
-
/** private: method[panIntoView]
* Pans the MapPanel's map so that an anchored popup can come entirely
* into view, with padding specified as per normal OpenLayers.Map popup
* padding.
*/
panIntoView: function() {
- if(!this.anchored) {
- /*
- * If it's not anchored, panning the map won't put popup into view
- */
- return;
- }
- this.position();
-
- var centerLonLat = this.feature.geometry.getBounds().getCenterLonLat();
+ var centerLonLat = this.feature.geometry.getBounds().getCenterLonLat();
var centerPx = this.map.getViewPortPxFromLonLat(centerLonLat);
+ var mapBox = Ext.fly(this.map.div).getBox();
//assumed viewport takes up whole body element of map panel
var popupPos = this.getPosition(true);
+ popupPos[0] -= mapBox.x;
+ popupPos[1] -= mapBox.y;
- var panelSize = [this.mapPanel.getInnerWidth(), this.mapPanel.getInnerHeight()]; // [X,Y]
+ var panelSize = [mapBox.width, mapBox.height]; // [X,Y]
var popupSize = this.getSize();
@@ -354,15 +300,56 @@
this.map.pan(dx, dy);
},
+
+ /** private: method[onMapMove]
+ */
+ onMapMove: function() {
+ this._mapMove = true;
+ this.position();
+ delete this._mapMove;
+ },
+
+ /** private: method[addAnchorEvents]
+ */
+ addAnchorEvents: function() {
+ this.map.events.on({
+ "move" : this.onMapMove,
+ scope : this
+ });
+
+ this.on({
+ "resize": this.position,
+ "collapse": this.position,
+ "expand": this.position,
+ scope: this
+ });
+ },
+
+ /** private: method[removeAnchorEvents]
+ */
+ removeAnchorEvents: function() {
+ //stop position with feature
+ this.map.events.un({
+ "move" : this.onMapMove,
+ scope : this
+ });
+ this.un("resize", this.position, this);
+ this.un("collapse", this.position, this);
+ this.un("expand", this.position, this);
+
+ },
+
/** private: method[beforeDestroy]
* Cleanup events before destroying the popup.
*/
beforeDestroy: function() {
- this.removeFromMapPanel();
+ if(this.anchored) {
+ this.removeAnchorEvents();
+ }
GeoExt.Popup.superclass.beforeDestroy.call(this);
}
});
-/** api: xtype = gx_mappanel */
+/** api: xtype = gx_popup */
Ext.reg('gx_popup', GeoExt.Popup);
Copied: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/ZoomSlider.js (from rev 1041, core/trunk/geoext/lib/GeoExt/widgets/ZoomSlider.js)
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/ZoomSlider.js (rev 0)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/ZoomSlider.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -0,0 +1,255 @@
+/**
+ * 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.
+ */
+
+/**
+ * @include GeoExt/widgets/tips/ZoomSliderTip.js
+ */
+
+/** api: (define)
+ * module = GeoExt
+ * class = ZoomSlider
+ * base_link = `Ext.Slider <http://extjs.com/deploy/dev/docs/?class=Ext.Slider>`_
+ */
+Ext.namespace("GeoExt");
+
+/** api: example
+ * Sample code to render a slider outside the map viewport:
+ *
+ * .. code-block:: javascript
+ *
+ * var slider = new GeoExt.ZoomSlider({
+ * renderTo: document.body,
+ * width: 200,
+ * map: map
+ * });
+ *
+ * Sample code to add a slider to a map panel:
+ *
+ * .. code-block:: javascript
+ *
+ * var panel = new GeoExt.MapPanel({
+ * renderTo: document.body,
+ * height: 300,
+ * width: 400,
+ * map: {
+ * controls: [new OpenLayers.Control.Navigation()]
+ * },
+ * layers: [new OpenLayers.Layer.WMS(
+ * "Global Imagery",
+ * "http://demo.opengeo.org/geoserver/wms",
+ * {layers: "bluemarble"}
+ * )],
+ * extent: [-5, 35, 15, 55],
+ * items: [{
+ * xtype: "gx_zoomslider",
+ * vertical: true,
+ * height: 100,
+ * x: 10,
+ * y: 20
+ * }]
+ * });
+ */
+
+/** api: constructor
+ * .. class:: ZoomSlider(config)
+ *
+ * Create a slider for controlling a map's zoom level.
+ */
+GeoExt.ZoomSlider = Ext.extend(Ext.Slider, {
+
+ /** api: config[map]
+ * ``OpenLayers.Map`` or :class:`GeoExt.MapPanel`
+ * The map that the slider controls.
+ */
+ map: null,
+
+ /** api: config[baseCls]
+ * ``String``
+ * The CSS class name for the slider elements. Default is "gx-zoomslider".
+ */
+ baseCls: "gx-zoomslider",
+
+ /** private: property[updating]
+ * ``Boolean``
+ * The slider position is being updated by itself (based on map zoomend).
+ */
+ updating: false,
+
+ /** private: method[initComponent]
+ * Initialize the component.
+ */
+ initComponent: function() {
+ GeoExt.ZoomSlider.superclass.initComponent.call(this);
+
+ if(this.map) {
+ if(this.map instanceof GeoExt.MapPanel) {
+ this.map = this.map.map;
+ }
+ this.bind(this.map);
+ }
+ this.on({
+ "changecomplete": this.changeHandler,
+ "beforedestroy": this.unbind,
+ scope: this
+ });
+
+ },
+
+ /** private: method[onRender]
+ * Override onRender to set base css class.
+ */
+ onRender: function() {
+ GeoExt.ZoomSlider.superclass.onRender.apply(this, arguments);
+ this.el.addClass(this.baseCls);
+ },
+
+ /** private: method[afterRender]
+ * Override afterRender because the render event is fired too early
+ * to call update.
+ */
+ afterRender : function(){
+ Ext.Slider.superclass.afterRender.apply(this, arguments);
+ this.update();
+ },
+
+ /** private: method[addToMapPanel]
+ * :param panel: :class:`GeoExt.MapPanel`
+ *
+ * Called by a MapPanel if this component is one of the items in the panel.
+ */
+ addToMapPanel: function(panel) {
+ this.on({
+ render: function() {
+ var el = this.getEl();
+ el.setStyle({
+ position: "absolute",
+ zIndex: panel.map.Z_INDEX_BASE.Control
+ });
+ el.on({
+ mousedown: this.stopMouseEvents,
+ click: this.stopMouseEvents
+ });
+ },
+ scope: this
+ });
+ this.bind(panel.map);
+ },
+
+ /** private: method[stopMouseEvents]
+ * :param e: ``Object``
+ */
+ stopMouseEvents: function(e) {
+ e.stopEvent();
+ },
+
+ /** private: method[removeFromMap]
+ * :param panel: :class:`GeoExt.MapPanel`
+ *
+ * Called by a MapPanel if this component is one of the items in the panel.
+ */
+ removeFromMapPanel: function(panel) {
+ var el = this.getEl();
+ el.un("mousedown", this.stopMouseEvents, this);
+ el.un("click", this.stopMouseEvents, this);
+ this.unbind();
+ },
+
+ /** private: method[bind]
+ * :param map: ``OpenLayers.Map``
+ */
+ bind: function(map) {
+ this.map = map;
+ this.map.events.on({
+ zoomend: this.update,
+ changebaselayer: this.initZoomValues,
+ scope: this
+ });
+ if(this.map.baseLayer) {
+ this.initZoomValues();
+ }
+ },
+
+ /** private: method[unbind]
+ */
+ unbind: function() {
+ if(this.map) {
+ this.map.events.un({
+ zoomend: this.update,
+ changebaselayer: this.initZoomValues,
+ scope: this
+ });
+ }
+ },
+
+ /** private: method[initZoomValues]
+ * Set the min/max values for the slider if not set in the config.
+ */
+ initZoomValues: function() {
+ var layer = this.map.baseLayer;
+ if(this.initialConfig.minValue === undefined) {
+ this.minValue = layer.minZoomLevel || 0;
+ }
+ if(this.initialConfig.maxValue === undefined) {
+ this.maxValue = layer.maxZoomLevel || layer.numZoomLevels - 1;
+ }
+ },
+
+ /** api: method[getZoom]
+ * :return: ``Number`` The map zoom level.
+ *
+ * Get the zoom level for the associated map based on the slider value.
+ */
+ getZoom: function() {
+ return this.getValue();
+ },
+
+ /** api: method[getScale]
+ * :return: ``Number`` The map scale denominator.
+ *
+ * Get the scale denominator for the associated map based on the slider value.
+ */
+ getScale: function() {
+ return OpenLayers.Util.getScaleFromResolution(
+ this.map.getResolutionForZoom(this.getValue()),
+ this.map.getUnits()
+ );
+ },
+
+ /** api: method[getResolution]
+ * :return: ``Number`` The map resolution.
+ *
+ * Get the resolution for the associated map based on the slider value.
+ */
+ getResolution: function() {
+ return this.map.getResolutionForZoom(this.getValue());
+ },
+
+ /** private: method[changeHandler]
+ * Registered as a listener for slider changecomplete. Zooms the map.
+ */
+ changeHandler: function() {
+ if(this.map && !this.updating) {
+ this.map.zoomTo(this.getValue());
+ }
+ },
+
+ /** private: method[update]
+ * Registered as a listener for map zoomend. Updates the value of the slider.
+ */
+ update: function() {
+ if(this.rendered && this.map) {
+ this.updating = true;
+ this.setValue(this.map.getZoom());
+ this.updating = false;
+ }
+ }
+
+});
+
+/** api: xtype = gx_zoomslider */
+Ext.reg('gx_zoomslider', GeoExt.ZoomSlider);
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/BasicForm.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/BasicForm.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/BasicForm.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/**
* @include GeoExt/widgets/form/SearchAction.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/FormPanel.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/FormPanel.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/FormPanel.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt.form
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/SearchAction.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/SearchAction.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form/SearchAction.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
/** api: (define)
* module = GeoExt.form
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/form.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * pending approval */
+ */
Ext.namespace("GeoExt.form");
Copied: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips (from rev 1041, core/trunk/geoext/lib/GeoExt/widgets/tips)
Deleted: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/tips/SliderTip.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,125 +0,0 @@
-/**
- * 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
- * class = SliderTip
- * base_link = `Ext.Tip <http://extjs.com/deploy/dev/docs/?class=Ext.Tip>`_
- */
-Ext.namespace("GeoExt");
-
-/** api: example
- * Sample code to create a slider tip to display slider value on hover:
- *
- * .. code-block:: javascript
- *
- * var slider = new Ext.Slider({
- * renderTo: document.body,
- * width: 200,
- * plugins: new GeoExt.SliderTip()
- * });
- */
-
-/** api: constructor
- * .. class:: SliderTip(config)
- *
- * Create a slider tip displaying ``Ext.Slider`` values over slider thumbs.
- */
-GeoExt.SliderTip = Ext.extend(Ext.Tip, {
-
- /** api: config[hover]
- * ``Boolean``
- * Display the tip when hovering over the thumb. If ``false``, tip will
- * only be displayed while dragging. Default is ``true``.
- */
- hover: true,
-
- /** api: config[minWidth]
- * ``Number``
- * Minimum width of the tip. Default is 10.
- */
- minWidth: 10,
-
- /** api: config[minWidth]
- * ``Number``
- * Minimum width of the tip. Default is 10.
- */
- minWidth: 10,
-
- /** api: config[offsets]
- * ``Array(Number)``
- * A two item list that provides x, y offsets for the tip. Default is
- * [0, -10].
- */
- offsets : [0, -10],
-
- /** private: property[dragging]
- * ``Boolean``
- * The thumb is currently being dragged.
- */
- dragging: false,
-
- /** private: method[init]
- * :param slider: ``Ext.Slider``
- *
- * Called when the plugin is initialized.
- */
- init: function(slider) {
- slider.on({
- dragstart: this.onSlide,
- drag: this.onSlide,
- dragend: this.hide,
- destroy: this.destroy,
- scope: this
- });
- if(this.hover) {
- slider.on("render", this.registerThumbListeners, this);
- }
- this.slider = slider;
- },
-
- /** private: method[registerThumbListeners]
- * Set as a listener for 'render' if hover is true.
- */
- registerThumbListeners: function() {
- this.slider.thumb.on({
- "mouseover": function() {
- this.onSlide(this.slider);
- this.dragging = false;
- },
- "mouseout": function() {
- if(!this.dragging) {
- this.hide.apply(this, arguments);
- }
- },
- scope: this
- });
- },
-
- /** private: method[onSlide]
- * :param slider: ``Ext.Slider``
- *
- * Listener for dragstart and drag.
- */
- onSlide: function(slider) {
- this.dragging = true;
- this.show();
- this.body.update(this.getText(slider));
- this.doAutoWidth();
- this.el.alignTo(slider.thumb, 'b-t?', this.offsets);
- },
-
- /** api: config[getText]
- * ``Function``
- * Function that generates the string value to be displayed in the tip. By
- * default, the return from slider.getValue() is displayed.
- */
- getText : function(slider) {
- return slider.getValue();
- }
-});
Copied: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js (from rev 1041, core/trunk/geoext/lib/GeoExt/widgets/tips/SliderTip.js)
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js (rev 0)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/SliderTip.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -0,0 +1,125 @@
+/**
+ * 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
+ * class = SliderTip
+ * base_link = `Ext.Tip <http://extjs.com/deploy/dev/docs/?class=Ext.Tip>`_
+ */
+Ext.namespace("GeoExt");
+
+/** api: example
+ * Sample code to create a slider tip to display slider value on hover:
+ *
+ * .. code-block:: javascript
+ *
+ * var slider = new Ext.Slider({
+ * renderTo: document.body,
+ * width: 200,
+ * plugins: new GeoExt.SliderTip()
+ * });
+ */
+
+/** api: constructor
+ * .. class:: SliderTip(config)
+ *
+ * Create a slider tip displaying ``Ext.Slider`` values over slider thumbs.
+ */
+GeoExt.SliderTip = Ext.extend(Ext.Tip, {
+
+ /** api: config[hover]
+ * ``Boolean``
+ * Display the tip when hovering over the thumb. If ``false``, tip will
+ * only be displayed while dragging. Default is ``true``.
+ */
+ hover: true,
+
+ /** api: config[minWidth]
+ * ``Number``
+ * Minimum width of the tip. Default is 10.
+ */
+ minWidth: 10,
+
+ /** api: config[minWidth]
+ * ``Number``
+ * Minimum width of the tip. Default is 10.
+ */
+ minWidth: 10,
+
+ /** api: config[offsets]
+ * ``Array(Number)``
+ * A two item list that provides x, y offsets for the tip. Default is
+ * [0, -10].
+ */
+ offsets : [0, -10],
+
+ /** private: property[dragging]
+ * ``Boolean``
+ * The thumb is currently being dragged.
+ */
+ dragging: false,
+
+ /** private: method[init]
+ * :param slider: ``Ext.Slider``
+ *
+ * Called when the plugin is initialized.
+ */
+ init: function(slider) {
+ slider.on({
+ dragstart: this.onSlide,
+ drag: this.onSlide,
+ dragend: this.hide,
+ destroy: this.destroy,
+ scope: this
+ });
+ if(this.hover) {
+ slider.on("render", this.registerThumbListeners, this);
+ }
+ this.slider = slider;
+ },
+
+ /** private: method[registerThumbListeners]
+ * Set as a listener for 'render' if hover is true.
+ */
+ registerThumbListeners: function() {
+ this.slider.thumb.on({
+ "mouseover": function() {
+ this.onSlide(this.slider);
+ this.dragging = false;
+ },
+ "mouseout": function() {
+ if(!this.dragging) {
+ this.hide.apply(this, arguments);
+ }
+ },
+ scope: this
+ });
+ },
+
+ /** private: method[onSlide]
+ * :param slider: ``Ext.Slider``
+ *
+ * Listener for dragstart and drag.
+ */
+ onSlide: function(slider) {
+ this.dragging = true;
+ this.show();
+ this.body.update(this.getText(slider));
+ this.doAutoWidth();
+ this.el.alignTo(slider.thumb, 'b-t?', this.offsets);
+ },
+
+ /** api: config[getText]
+ * ``Function``
+ * Function that generates the string value to be displayed in the tip. By
+ * default, the return from slider.getValue() is displayed.
+ */
+ getText : function(slider) {
+ return slider.getValue();
+ }
+});
Deleted: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/tips/ZoomSliderTip.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,84 +0,0 @@
-/**
- * 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.
- */
-
-/**
- * @requires GeoExt/widgets/tips/SliderTip.js
- */
-
-/** api: (extends)
- * GeoExt/widgets/tips/SliderTip.js
- */
-
-/** api: (define)
- * module = GeoExt
- * class = ZoomSliderTip
- * base_link = `Ext.Tip <http://extjs.com/deploy/dev/docs/?class=Ext.Tip>`_
- */
-Ext.namespace("GeoExt");
-
-/** api: example
- * Sample code to create a slider tip to display scale and resolution:
- *
- * .. code-block:: javascript
- *
- * var slider = new GeoExt.ZoomSlider({
- * renderTo: document.body,
- * width: 200,
- * map: map,
- * plugins: new GeoExt.ZoomSliderTip({
- * template: "Scale: 1 : {scale}<br>Resolution: {resolution}"
- * })
- * });
- */
-
-/** api: constructor
- * .. class:: ZoomSliderTip(config)
- *
- * Create a slider tip displaying :class:`GeoExt.ZoomSlider` values.
- */
-GeoExt.ZoomSliderTip = Ext.extend(GeoExt.SliderTip, {
-
- /** api: config[template]
- * ``String``
- * Template for the tip. Can be customized using the following keywords in
- * curly braces:
- *
- * * ``zoom`` - the zoom level
- * * ``resolution`` - the resolution
- * * ``scale`` - the scale denominator
- */
- template: '<div>Zoom Level: {zoom}</div>' +
- '<div>Resolution: {resolution}</div>' +
- '<div>Scale: 1 : {scale}</div>',
-
- /** private: property[compiledTemplate]
- * ``Ext.Template``
- * The template compiled from the ``template`` string on init.
- */
- compiledTemplate: null,
-
- /** private: method[init]
- * Called to initialize the plugin.
- */
- init: function(slider) {
- this.compiledTemplate = new Ext.Template(this.template);
- GeoExt.ZoomSliderTip.superclass.init.call(this, slider);
- },
-
- /** private: method[getText]
- * :param slider: ``Ext.Slider`` The slider this tip is attached to.
- */
- getText: function(slider) {
- var data = {
- zoom: slider.getZoom(),
- resolution: slider.getResolution(),
- scale: Math.round(slider.getScale())
- };
- return this.compiledTemplate.apply(data);
- }
-});
Copied: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js (from rev 1041, core/trunk/geoext/lib/GeoExt/widgets/tips/ZoomSliderTip.js)
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js (rev 0)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tips/ZoomSliderTip.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -0,0 +1,84 @@
+/**
+ * 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.
+ */
+
+/**
+ * @requires GeoExt/widgets/tips/SliderTip.js
+ */
+
+/** api: (extends)
+ * GeoExt/widgets/tips/SliderTip.js
+ */
+
+/** api: (define)
+ * module = GeoExt
+ * class = ZoomSliderTip
+ * base_link = `Ext.Tip <http://extjs.com/deploy/dev/docs/?class=Ext.Tip>`_
+ */
+Ext.namespace("GeoExt");
+
+/** api: example
+ * Sample code to create a slider tip to display scale and resolution:
+ *
+ * .. code-block:: javascript
+ *
+ * var slider = new GeoExt.ZoomSlider({
+ * renderTo: document.body,
+ * width: 200,
+ * map: map,
+ * plugins: new GeoExt.ZoomSliderTip({
+ * template: "Scale: 1 : {scale}<br>Resolution: {resolution}"
+ * })
+ * });
+ */
+
+/** api: constructor
+ * .. class:: ZoomSliderTip(config)
+ *
+ * Create a slider tip displaying :class:`GeoExt.ZoomSlider` values.
+ */
+GeoExt.ZoomSliderTip = Ext.extend(GeoExt.SliderTip, {
+
+ /** api: config[template]
+ * ``String``
+ * Template for the tip. Can be customized using the following keywords in
+ * curly braces:
+ *
+ * * ``zoom`` - the zoom level
+ * * ``resolution`` - the resolution
+ * * ``scale`` - the scale denominator
+ */
+ template: '<div>Zoom Level: {zoom}</div>' +
+ '<div>Resolution: {resolution}</div>' +
+ '<div>Scale: 1 : {scale}</div>',
+
+ /** private: property[compiledTemplate]
+ * ``Ext.Template``
+ * The template compiled from the ``template`` string on init.
+ */
+ compiledTemplate: null,
+
+ /** private: method[init]
+ * Called to initialize the plugin.
+ */
+ init: function(slider) {
+ this.compiledTemplate = new Ext.Template(this.template);
+ GeoExt.ZoomSliderTip.superclass.init.call(this, slider);
+ },
+
+ /** private: method[getText]
+ * :param slider: ``Ext.Slider`` The slider this tip is attached to.
+ */
+ getText: function(slider) {
+ var data = {
+ zoom: slider.getZoom(),
+ resolution: slider.getResolution(),
+ scale: Math.round(slider.getScale())
+ };
+ return this.compiledTemplate.apply(data);
+ }
+});
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/BaseLayerContainer.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/BaseLayerContainer.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/BaseLayerContainer.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @requires GeoExt/widgets/tree/LayerContainer.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerContainer.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerContainer.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerContainer.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @include GeoExt/widgets/tree/LayerNode.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerNode.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerNode.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/LayerNode.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
Ext.namespace("GeoExt.tree");
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/OverlayLayerContainer.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/OverlayLayerContainer.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt/widgets/tree/OverlayLayerContainer.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
- * See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
+ * See http://svn.geoext.org/core/trunk/geoext/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/**
* @requires GeoExt/widgets/tree/LayerContainer.js
Modified: sandbox/camptocamp/geobretagne/lib/GeoExt.js
===================================================================
--- sandbox/camptocamp/geobretagne/lib/GeoExt.js 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/lib/GeoExt.js 2009-06-11 09:46:19 UTC (rev 1042)
@@ -1,9 +1,10 @@
-/* Copyright (C) 2008-2009 The Open Source Geospatial Foundation ¹
+/**
+ * Copyright (c) 2008-2009 The Open Source Geospatial Foundation
+ *
* Published under the BSD license.
* See http://geoext.org/svn/geoext/core/trunk/license.txt for the full text
* of the license.
- *
- * ¹ pending approval */
+ */
/*
* The code in this file is based on code taken from OpenLayers.
@@ -76,6 +77,8 @@
"GeoExt/widgets/form/SearchAction.js",
"GeoExt/widgets/form/BasicForm.js",
"GeoExt/widgets/form/FormPanel.js",
+ "GeoExt/widgets/tips/SliderTip.js",
+ "GeoExt/widgets/tips/ZoomSliderTip.js",
"GeoExt/widgets/tree/LayerNode.js",
"GeoExt/widgets/tree/LayerContainer.js",
"GeoExt/widgets/tree/BaseLayerContainer.js",
@@ -83,7 +86,8 @@
"GeoExt/widgets/LegendImage.js",
"GeoExt/widgets/LegendWMS.js",
"GeoExt/widgets/LegendPanel.js",
- "GeoExt/widgets/grid/FeatureSelectionModel.js"
+ "GeoExt/widgets/grid/FeatureSelectionModel.js",
+ "GeoExt/widgets/ZoomSlider.js"
);
var agent = navigator.userAgent;
Modified: sandbox/camptocamp/geobretagne/license.txt
===================================================================
--- sandbox/camptocamp/geobretagne/license.txt 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/license.txt 2009-06-11 09:46:19 UTC (rev 1042)
@@ -7,7 +7,7 @@
License
=======
-Copyright (c) 2008-2009, The Open Source Geospatial Foundation ¹
+Copyright (c) 2008-2009, The Open Source Geospatial Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,6 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
-¹ pending approval
Notice about ExtJS
Modified: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/ScaleStore.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/ScaleStore.html 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/data/ScaleStore.html 2009-06-11 09:46:19 UTC (rev 1042)
@@ -45,6 +45,8 @@
map = createMap();
store = new GeoExt.data.ScaleStore({map: map});
t.ok(store.map == map, "ctor sets the passed map in the instance");
+
+ map.destroy();
}
function test_bind_unbind(t) {
@@ -84,15 +86,31 @@
store.unbind();
t.eq(map.events.listeners["changebaselayer"][0], undefined,
"unbind unregisters changebaselayer listener (map has a base layer)");
+
+ map.destroy();
}
function test_scalestore(t) {
- t.plan(1);
+ t.plan(3);
var mapPanel = loadMapPanel();
var map = mapPanel.map;
var store = new GeoExt.data.ScaleStore({map: map});
- t.eq(store.data.length, 15, 'Found expected number of zoomlevels');
+ var levels = map.baseLayer.resolutions.length;
+ t.eq(store.getCount(), levels,
+ 'Found expected number of zoomlevels: ' + levels);
+
+ var low = store.getAt(0).get("resolution");
+ t.eq(low, map.baseLayer.resolutions[levels-1],
+ 'First record has lowest res value: ' + low);
+
+ var high = store.getAt(levels-1).get("resolution");
+ t.eq(high, map.baseLayer.resolutions[0],
+ 'Last record has highest res value: ' + high);
+
+ map.destroy();
+ mapPanel.destroy();
+
}
</script>
Modified: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/Popup.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/Popup.html 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/Popup.html 2009-06-11 09:46:19 UTC (rev 1042)
@@ -29,9 +29,13 @@
});
var feature = new OpenLayers.Feature.Vector(
- new OpenLayers.Geometry.Point(100,50),
+ new OpenLayers.Geometry.Point(5,45),
{name: "My Feature"}
);
+ feature.layer = {
+ map: map,
+ removeFeatures: function() {}
+ };
return {
feature: feature,
@@ -63,9 +67,9 @@
var pop = popup(context.feature);
- context.mapPanel.add(pop);
+ pop.show();
- t.ok(context.mapPanel.el.child("div." + pop.popupCls),"Map panel contains popup");
+ t.ok(Ext.getBody().child("div." + pop.popupCls),"viewport contains popup");
tearDown(context);
}
@@ -77,7 +81,7 @@
var pop = popup(context.feature);
- context.mapPanel.add(pop);
+ pop.show();
pop.on({
'move' : function(c,x,y){
@@ -102,13 +106,13 @@
function test_unanchorPopup(t) {
- t.plan(6);
+ t.plan(4);
var context = setupContext();
var pop = popup(context.feature, context.mapPanel);
- context.mapPanel.add(pop);
+ pop.show();
pop.collapse();
@@ -120,8 +124,6 @@
t.ok(!pop.getAnchorElement(),"Anchor element removed");
t.ok(!this.collapsed, "Preserved collapsed state");
- t.ok(!context.mapPanel.el.child("div." + pop.popupCls),"Map panel does not contain popup");
- t.ok(Ext.getBody().child("div." + pop.popupCls),"Document body contains popup element");
t.eq(origPos[0],newPos[0],"Popup remains in same position (X)");
t.eq(origPos[1],newPos[1],"Popup remains in same position (Y)");
@@ -151,7 +153,7 @@
var context = setupContext();
var pop = popup(context.feature);
- context.mapPanel.add(pop);
+ pop.show();
var called = false;
pop.on({
Copied: sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/ZoomSlider.html (from rev 1041, core/trunk/geoext/tests/lib/GeoExt/widgets/ZoomSlider.html)
===================================================================
--- sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/ZoomSlider.html (rev 0)
+++ sandbox/camptocamp/geobretagne/tests/lib/GeoExt/widgets/ZoomSlider.html 2009-06-11 09:46:19 UTC (rev 1042)
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<html debug="true">
+ <head>
+ <script type="text/javascript" src="../../../../../openlayers/lib/OpenLayers.js"></script>
+ <script type="text/javascript" src="../../../../../ext/adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../../../../../ext/ext-all-debug.js"></script>
+ <script type="text/javascript" src="../../../../lib/GeoExt.js"></script>
+
+ <script type="text/javascript">
+
+ function test_zoomslider(t) {
+ t.plan(7);
+
+ var map = new OpenLayers.Map({
+ div: "map",
+ allOverlays: true
+ });
+ map.addLayer(new OpenLayers.Layer());
+ map.setCenter(new OpenLayers.LonLat(0, 0), 2);
+
+ var slider = new GeoExt.ZoomSlider({
+ map: map,
+ renderTo: document.body
+ });
+
+ // test range of values
+ t.eq(slider.minValue, 0, "slider min is 0");
+ t.eq(slider.maxValue, 15, "slider can go to 15");
+
+ // test initial value
+ t.eq(slider.getValue(), 2, "slider has correct value after setCenter");
+
+ // zoom in and test that value is updated
+ map.zoomIn();
+ t.eq(slider.getValue(), 3, "slider has correct value after zoomIn");
+
+ // test that zoomTo updates slider value
+ map.zoomTo(0);
+ t.eq(slider.getValue(), 0, "slider has correct value after zoomTo");
+
+ // test that slider can be destroyed
+ try {
+ slider.destroy();
+ t.ok(true, "slider.destroy does not cause problems");
+ } catch(err) {
+ t.fail("slider.destroy causes problems: " + err);
+ }
+
+ // test that map can be zoomed without trouble after slider destroy
+ try {
+ map.zoomIn();
+ t.ok(true, "map.zoomIn does not cause problems after slider.destroy");
+ } catch(err) {
+ t.fail("map.zoomIn causes problems after slider.destroy: " + err);
+ }
+
+ map.destroy();
+
+ }
+
+ </script>
+ <body>
+ <div id="map" style="width: 512px; height: 256px;"></div>
+ </body>
+</html>
Modified: sandbox/camptocamp/geobretagne/tests/list-tests.html
===================================================================
--- sandbox/camptocamp/geobretagne/tests/list-tests.html 2009-06-10 20:52:09 UTC (rev 1041)
+++ sandbox/camptocamp/geobretagne/tests/list-tests.html 2009-06-11 09:46:19 UTC (rev 1042)
@@ -20,4 +20,5 @@
<li>lib/GeoExt/widgets/tree/LayerContainer.html</li>
<li>lib/GeoExt/widgets/LegendPanel.html</li>
<li>lib/GeoExt/widgets/grid/FeatureSelectionModel.html</li>
+ <li>lib/GeoExt/widgets/ZoomSlider.html</li>
</ul>
More information about the Commits
mailing list