Permalink
Browse files

minor minor

  • Loading branch information...
1 parent 37ddc77 commit 8763f747ca2bd95c1302969bcac10053ff15615e Zachary Johnson committed Oct 31, 2011
Showing 1,274 changed files with 102,952 additions and 4 deletions.
@@ -164,6 +164,18 @@ ol.thematic.Choropleth = OpenLayers.Class( ol.thematic.LayerBase,
CLASS_NAME: "ol.thematic.Choropleth"
});
+ol.thematic.Choropleth.createColorSchemeRepresentation = function( choropleth, div )
+{
+
+ // create initial representation
+
+
+
+ // make it update itself
+
+
+};
+
OpenLayers.Rico.Color.createFromRGB = function( rgb )
{
var digits = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,(\d+)\s*\)/.exec( rgb );
View
@@ -16,11 +16,45 @@ div.control {
margin-left: 30px;
margin-bottom: 10px;
}
-div.control select {
+div.control select, div.control div#colorScheme, div.control div#classBreaks-slider {
margin-left: 30px;
}
input#dotValue {
width: 100px;
margin-right: 5px;
margin-left: 5px;
-}
+}
+
+div#colorScheme {
+ border: 1px solid #000;
+
+ width: 300px;
+ height: 30px;
+
+ margin-bottom: 12px;
+}
+
+div.colorChip {
+ float: left;
+ height: 100%;
+}
+
+h1 {
+ font-size: 18px;
+ margin-bottom: 20px;
+}
+
+h2 {
+ font-size: 16px;
+ margin-bottom: 18px;
+}
+
+h3 {
+ font-size: 14px;
+ margin-bottom: 16px;
+}
+
+h4 {
+ font-size: 12px;
+ margin-bottom: 14px;
+}
View
@@ -3,19 +3,24 @@
<title>OpenLayers-Symbology Choropleth example</title>
<!-- styles -->
+ <link rel="stylesheet" type="text/css" href="ext-js/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../style/css/ol.thematic.css" />
<!-- external libraries ( ol, colorbrewer, jquery ) -->
<script type="text/javascript" src="http://openlayers.org/dev/OpenLayers.js"></script>
<script type="text/javascript" src="../style/js/colorbrewer.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
-
+ <script type="text/javascript" src="ext-js/bootstrap.js"></script>
+
<!-- local symbology code -->
<script type="text/javascript" src="../src/js/ol/thematic/ol.classification.js"></script>
<script type="text/javascript" src="../src/js/ol/thematic/ol.thematic.js"></script>
<script type="text/javascript" src="../src/js/ol/thematic/ol.choropleth.js"></script>
<script type="text/javascript">
+
+ Ext.require('Ext.slider.*');
+
var map, choroLayer,
url = '../data/json/county_unemployment.geo.json',
indicator = 'unemployment rate',
@@ -84,8 +89,23 @@
}
});
+ // create self-updating color scheme representation
+ // ol.thematic.Choropleth.createColorSchemeRepresentation( choroLayer, 'div#colorScheme' );
+
+ // class breaks
- // TODO: breaks
+ var slider = new Ext.slider.Multi( {
+ renderTo: 'classBreaks-slider',
+ hideLabel: false,
+
+ width: 300,
+
+ minValue: choroLayer.distribution.minVal,
+ maxValue: choroLayer.distribution.maxVal/*,
+ values: choroLayer.classification.getBoundsArray()*/
+ });
+
+ slider.values = choroLayer.classification.getBoundsArray();
// color schemes
@@ -210,6 +230,13 @@
<h4>classification method</h4>
<select id="classMethods"></select>
</div>
+
+ <div class="control" id="legend">
+ <h4>the legend is the key</h4>
+
+ <div id="colorScheme"></div>
+ <div id="classBreaks-slider"></div>
+ </div>
</div>
View
@@ -0,0 +1,73 @@
+/*
+
+This file is part of Ext JS 4
+
+Copyright (c) 2011 Sencha Inc
+
+Contact: http://www.sencha.com/contact
+
+GNU General Public License Usage
+This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
+
+If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
+
+*/
+/**
+ * Load the library located at the same path with this file
+ *
+ * Will automatically load ext-all-debug.js if any of these conditions is true:
+ * - Current hostname is localhost
+ * - Current hostname is an IP v4 address
+ * - Current protocol is "file:"
+ *
+ * Will load ext-all.js (minified) otherwise
+ */
+(function() {
+
+ var scripts = document.getElementsByTagName('script'),
+ localhostTests = [
+ /^localhost$/,
+ /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(:\d{1,5})?\b/ // IP v4
+ ],
+ host = window.location.hostname,
+ isDevelopment = null,
+ queryString = window.location.search,
+ test, path, i, ln, scriptSrc, match;
+
+ for (i = 0, ln = scripts.length; i < ln; i++) {
+ scriptSrc = scripts[i].src;
+
+ match = scriptSrc.match(/bootstrap\.js$/);
+
+ if (match) {
+ path = scriptSrc.substring(0, scriptSrc.length - match[0].length);
+ break;
+ }
+ }
+
+ if (queryString.match('(\\?|&)debug') !== null) {
+ isDevelopment = true;
+ }
+ else if (queryString.match('(\\?|&)nodebug') !== null) {
+ isDevelopment = false;
+ }
+
+ if (isDevelopment === null) {
+ for (i = 0, ln = localhostTests.length; i < ln; i++) {
+ test = localhostTests[i];
+
+ if (host.search(test) !== -1) {
+ isDevelopment = true;
+ break;
+ }
+ }
+ }
+
+ if (isDevelopment === null && window.location.protocol === 'file:') {
+ isDevelopment = true;
+ }
+
+ document.write('<script type="text/javascript" src="' + path + 'ext-all' + ((isDevelopment) ? '-debug' : '') + '.js"></script>');
+
+})();
+
Oops, something went wrong.

0 comments on commit 8763f74

Please sign in to comment.