[OpenLayers-Commits] r11243 -
sandbox/camptocamp/mobile/openlayers/examples
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Tue Feb 22 09:40:37 EST 2011
Author: pgiraud
Date: 2011-02-22 06:40:37 -0800 (Tue, 22 Feb 2011)
New Revision: 11243
Modified:
sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html
sandbox/camptocamp/mobile/openlayers/examples/mobile.html
sandbox/camptocamp/mobile/openlayers/examples/mobile.js
Log:
Adding the zoom in/out buttons
Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html 2011-02-22 14:39:49 UTC (rev 11242)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile-jq.html 2011-02-22 14:40:37 UTC (rev 11243)
@@ -37,6 +37,17 @@
bottom: 5px;
right: 5px;
}
+
+ #navigation {
+ position: absolute;
+ bottom: 50px;
+ left: 10px;
+ z-index: 1000;
+ }
+ #navigation .ui-btn-icon-notext {
+ display: block;
+ }
+
</style>
<script>
$(document).ready(function() {
@@ -60,6 +71,14 @@
}
$(window).bind("orientationchange resize pageshow", fixContentHeight);
fixContentHeight();
+
+ // Map zoom
+ $("#plus").click(function(){
+ map.zoomIn();
+ });
+ $("#minus").click(function(){
+ map.zoomOut();
+ });
});
</script>
@@ -75,6 +94,14 @@
<a href="" data-icon="locate" data-role="button">Locate</a>
<a href="" data-icon="layers" data-role="button">Layers</a>
</div>
+ <div id="navigation" data-role="controlgroup" data-type="vertical">
+ <a href="#" data-role="button" data-icon="plus"
+ id="plus"
+ data-iconpos="notext"></a>
+ <a href="#" data-role="button" data-icon="minus"
+ id="minus"
+ data-iconpos="notext"></a>
+ </div>
</div>
</body>
</html>
Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile.html
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile.html 2011-02-22 14:39:49 UTC (rev 11242)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile.html 2011-02-22 14:40:37 UTC (rev 11243)
@@ -29,6 +29,7 @@
<div id="map"></div>
<script>
init();
+ map.addControl(new OpenLayers.Control.ZoomPanel());
</script>
</body>
</html>
Modified: sandbox/camptocamp/mobile/openlayers/examples/mobile.js
===================================================================
--- sandbox/camptocamp/mobile/openlayers/examples/mobile.js 2011-02-22 14:39:49 UTC (rev 11242)
+++ sandbox/camptocamp/mobile/openlayers/examples/mobile.js 2011-02-22 14:40:37 UTC (rev 11243)
@@ -35,8 +35,7 @@
new OpenLayers.Control.DrawFeature(
vector, OpenLayers.Handler.Polygon, {id: "poly-control"}
),
- new OpenLayers.Control.ModifyFeature(vector, {id: "mod-control"}),
- new OpenLayers.Control.ZoomPanel()
+ new OpenLayers.Control.ModifyFeature(vector, {id: "mod-control"})
],
layers: [new OpenLayers.Layer.OSM(), vector],
center: new OpenLayers.LonLat(0, 0),
More information about the Commits
mailing list