[OpenLayers-Commits] r11239 - in sandbox/camptocamp/mobile/openlayers: . examples lib/OpenLayers/Control

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Tue Feb 22 09:30:04 EST 2011


Author: fredj
Date: 2011-02-22 06:30:03 -0800 (Tue, 22 Feb 2011)
New Revision: 11239

Modified:
   sandbox/camptocamp/mobile/openlayers/
   sandbox/camptocamp/mobile/openlayers/examples/example-list.html
   sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html
   sandbox/camptocamp/mobile/openlayers/examples/mobile-sencha.html
   sandbox/camptocamp/mobile/openlayers/examples/mobile.html
   sandbox/camptocamp/mobile/openlayers/examples/mobile.js
   sandbox/camptocamp/mobile/openlayers/lib/OpenLayers/Control/Geolocate.js
Log:
merge with trunk


Property changes on: sandbox/camptocamp/mobile/openlayers
___________________________________________________________________
Modified: svn:mergeinfo
   - /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11233
   + /sandbox/roberthl/openlayers:9745-9748
/trunk/openlayers:11233,11236-11238

Modified: sandbox/camptocamp/mobile/openlayers/examples/example-list.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/example-list.html	2011-02-22 14:22:00 UTC (rev 11238)
+++ sandbox/camptocamp/mobile/openlayers/examples/example-list.html	2011-02-22 14:30:03 UTC (rev 11239)
@@ -14,14 +14,24 @@
         <link rel="stylesheet" href="style.css" type="text/css" />
         <style type="text/css">
             html, body {
-                height: 100%;
-                overflow: hidden;
                 margin: 0;
                 padding: 0;
                 line-height: 1.25em;
             }
+            #logo {
+                text-shadow: 2px 2px 3px gray;
+                color: white;
+                vertical-align: middle;
+                position: absolute;
+                top: 5px;
+                left: 5px;
+                font-size: 34px;
+                font-family: "Trebuchet MS",Helvetica,Arial,sans-serif;
+            }
+            #logo img {
+                vertical-align: middle;
+            }
             .ex_container{
-                border-bottom: 1px solid #cccccc;
             }
             .ex_container a {
                 text-decoration: none;
@@ -57,20 +67,18 @@
                 display: none;
             }
             #toc {
-                width: 30%;
+                width: 100%;
                 height: 100%;
             }
             #filter {
+                position: fixed;
+                text-align: center;
                 top: 0px;
-                height: 50px;
-                padding: 10px 1em 10px 1em;
+                background: #9D9FA1;
+                width: 100%;
+                padding: 1.3em 0;
             }
             #examples {
-                border-top: 1px solid #cccccc;
-                position: absolute;
-                width: 30%;
-                top: 70px;
-                bottom: 0px;
                 overflow: auto;
                 list-style: none;
                 margin: 0;
@@ -80,12 +88,21 @@
                 list-style: none;
                 margin: 0;
                 padding: 0;
+                margin-top: 4em;
             }
             #examples ul li {
-                display: block;
-                margin: 0;
+                display: inline;
+                float: left;
+                width: 350px;
+                margin: 10px 0 0 10px;
                 padding: 0;
+                border: 1px solid #ddd;
+                border-radius: 3px;
             }
+            #examples .mainlink {
+                height: 8em;
+                overflow: hidden;
+            }
             #exwin {
                 position: absolute;
                 top: 0;
@@ -96,6 +113,26 @@
                 border-left: 1px solid #cccccc;
                 margin: 0;
             }
+            @media only screen and (max-width: 600px) {
+                #examples ul {
+                    margin-top: 100px;
+                }
+                #filter {
+                    padding-top: 50px;
+                }
+                #examples ul li {
+                    margin-left: 0;
+                    border-radius: 0;
+                    border-width: 1px 0;
+                    width: 100%;
+                }
+                #examples .mainlink {
+                    height: auto;
+                }
+                #examples .ex_tags, #examples .ex_filename {
+                    display: none;
+                }
+            }
         </style>
         <script type="text/javascript" src="Jugl.js"></script>
         <script type="text/javascript" src="example-list.js"></script>
@@ -133,7 +170,7 @@
                     for(var i=0; i<words.length; ++i) {
                         var word = words[i].toLowerCase()
                         var dict = info.index[word];
-                        if(dict) {
+                        var updateScores = function() {
                             for(exIndex in dict) {
                                 var count = dict[exIndex];
                                 if(scores[exIndex]) {
@@ -148,6 +185,18 @@
                                 }
                             }
                         }
+                        if(dict) {
+                            updateScores();
+                        } else {
+                            var r;
+                            for (idx in info.index) {
+                               r = new RegExp(word);
+                               if (r.test(idx)) {
+                                    dict = info.index[idx];
+                                    updateScores();
+                               }
+                            }
+                        }
                     }
                     examples = [];
                     for(var j in scores) {
@@ -201,10 +250,10 @@
                 }
             }
             window.onload = function() {
+                //document.getElementById('keywords').focus();
                 template = new jugl.Template("template");
                 target = document.getElementById("examples");
                 listExamples(info.examples);
-                document.getElementById("exwin").src = "../examples/example.html";
                 document.getElementById("keywords").onkeyup = inputChange
                 parseQuery();
             };
@@ -213,20 +262,24 @@
     <body>
         <div id="toc">
             <div id="filter">
+                <div id="logo">
+                <img src="http://www.openlayers.org/images/OpenLayers.trac.png"
+                 />
+                 OpenLayers
+             </div>
                 <p>
-                    <label for="keywords">Filter by keywords</label><br />
-                    <input type="text" id="keywords" />
-                    <span id="count"></span><br />
+                    <input autofocus placeholder="filter by keywords..." type="text" id="keywords" />
+                    <span id="count"></span>
                     <a href="javascript:void showAll();">show all</a>
                 </p>
             </div>
             <div id="examples"></div>
         </div>
-        <iframe id="exwin" name="exwin" frameborder="0"></iframe>        
         <div style="display: none;">
             <ul id="template">
                 <li class="ex_container" jugl:repeat="example examples">
-                    <a jugl:attributes="href example.link" target="exwin">
+                <a jugl:attributes="href example.link" class="mainlink"
+                    target="_blank">
                         <h5 class="ex_title">
                             <span jugl:replace="example.title">title</span><br />
                             <span class="ex_filename" jugl:content="'(' + example.example + ')'">filename</span>

Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html	2011-02-22 14:22:00 UTC (rev 11238)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html	2011-02-22 14:30:03 UTC (rev 11239)
@@ -9,7 +9,7 @@
         <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css">
         <script src="http://code.jquery.com/jquery-1.5.min.js"></script>
         <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
-        <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+        <link rel="stylesheet" href="style.mobile.css" type="text/css">
         <script src="../lib/OpenLayers.js"></script>
         <script src="mobile.js"></script>
         <style>

Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile-sencha.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile-sencha.html	2011-02-22 14:22:00 UTC (rev 11238)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile-sencha.html	2011-02-22 14:30:03 UTC (rev 11239)
@@ -6,7 +6,7 @@
         <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
         <title>OpenLayers with Sencha Touch</title>
         <script src="../lib/OpenLayers.js"></script>
-        <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+        <link rel="stylesheet" href="style.mobile.css" type="text/css">
         <link rel="stylesheet" href="http://dev.sencha.com/deploy/touch/resources/css/sencha-touch.css">
         <script src="http://dev.sencha.com/deploy/touch/sencha-touch.js"></script>
         <script src="mobile.js"></script>

Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile.html	2011-02-22 14:22:00 UTC (rev 11238)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile.html	2011-02-22 14:30:03 UTC (rev 11239)
@@ -4,7 +4,7 @@
         <title>OpenLayers Mobile</title>
         <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0;">
         <meta name="apple-mobile-web-app-capable" content="yes">
-        <link rel="stylesheet" href="../theme/default/style.css" type="text/css">
+        <link rel="stylesheet" href="style.mobile.css" type="text/css">
         <script src="../lib/OpenLayers.js"></script>
         <script src="mobile.js"></script>
         <style>

Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile.js
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile.js	2011-02-22 14:22:00 UTC (rev 11238)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile.js	2011-02-22 14:30:03 UTC (rev 11239)
@@ -19,7 +19,12 @@
             -20037508.34, -20037508.34, 20037508.34, 20037508.34
         ),
         controls: [
-            new OpenLayers.Control.TouchNavigation({dragPanOptions: {enableKinetic: true}}),
+            new OpenLayers.Control.TouchNavigation({
+                dragPanOptions: {
+                    interval: 0, // non-zero kills performance on some mobile phones
+                    enableKinetic: true
+                }
+            }),
             new OpenLayers.Control.Attribution(),
             new OpenLayers.Control.DrawFeature(
                 vector, OpenLayers.Handler.Point, {id: "point-control"}
@@ -30,7 +35,8 @@
             new OpenLayers.Control.DrawFeature(
                 vector, OpenLayers.Handler.Polygon, {id: "poly-control"}
             ),
-            new OpenLayers.Control.ModifyFeature(vector, {id: "mod-control"})
+            new OpenLayers.Control.ModifyFeature(vector, {id: "mod-control"}),
+            new OpenLayers.Control.ZoomPanel()
         ],
         layers: [new OpenLayers.Layer.OSM(), vector],
         center: new OpenLayers.LonLat(0, 0),

Modified: sandbox/camptocamp/mobile/openlayers/lib/OpenLayers/Control/Geolocate.js
===================================================================
--- sandbox/camptocamp/mobile/openlayers/lib/OpenLayers/Control/Geolocate.js	2011-02-22 14:22:00 UTC (rev 11238)
+++ sandbox/camptocamp/mobile/openlayers/lib/OpenLayers/Control/Geolocate.js	2011-02-22 14:30:03 UTC (rev 11239)
@@ -54,10 +54,17 @@
      * APIProperty: options
      *
      * {<Object>}
-     *    The geolocation API spec defines three optional parameters used for the position determination:
-     *    - enableHighAccuracy (boolean, default false): provides a hint that the application would like to receive the best possible results.
-     *    - timeout (long, default 0): denotes the maximum length of time (expressed in milliseconds) that is allowed to pass to callback.
-     *    - maximumAge (long, default Infinity): indicates that the application is willing to accept a cached position whose age is no greater than the specified time in milliseconds.
+     *    The geolocation API spec defines three optional parameters
+     *    used for the position determination: 
+     *    - enableHighAccuracy (boolean, default false): provides a
+     *        hint that the application would like to receive the best
+     *        possible results. 
+     *    - timeout (long, default 0): denotes the maximum length of
+     *        time (expressed in milliseconds) that is allowed to pass to
+     *        callback. 
+     *    - maximumAge (long, default Infinity): indicates that the
+     *        application is willing to accept a cached position whose age
+     *        is no greater than the specified time in milliseconds. 
      */
     options: null,
 



More information about the Commits mailing list