Merge pull request #450 from fbuchinger/patch-2
simplified jquery mobile example
This commit is contained in:
+16
-9
@@ -3,8 +3,6 @@ window.location.replace(window.location.href.split("#")[0] + "#mappage");
|
||||
|
||||
var selectedFeature = null;
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
// fix height of content
|
||||
function fixContentHeight() {
|
||||
var footer = $("div[data-role='footer']:visible"),
|
||||
@@ -28,17 +26,18 @@ $(document).ready(function() {
|
||||
initLayerList();
|
||||
}
|
||||
}
|
||||
$(window).bind("orientationchange resize pageshow", fixContentHeight);
|
||||
document.body.onload = fixContentHeight;
|
||||
|
||||
// Map zoom
|
||||
$("#plus").click(function(){
|
||||
// one-time initialisation of button handlers
|
||||
|
||||
$("#plus").live('click', function(){
|
||||
map.zoomIn();
|
||||
});
|
||||
$("#minus").click(function(){
|
||||
|
||||
$("#minus").live('click', function(){
|
||||
map.zoomOut();
|
||||
});
|
||||
$("#locate").click(function(){
|
||||
|
||||
$("#locate").live('click',function(){
|
||||
var control = map.getControlsBy("id", "locate-control")[0];
|
||||
if (control.active) {
|
||||
control.getCurrentLocation();
|
||||
@@ -47,6 +46,15 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
//fix the content height AFTER jQuery Mobile has rendered the map page
|
||||
$('#mappage').live('pageshow',function (){
|
||||
fixContentHeight();
|
||||
});
|
||||
|
||||
$(window).bind("orientationchange resize pageshow", fixContentHeight);
|
||||
|
||||
|
||||
|
||||
$('#popup').live('pageshow',function(event, ui){
|
||||
var li = "";
|
||||
for(var attr in selectedFeature.attributes){
|
||||
@@ -96,7 +104,6 @@ $(document).ready(function() {
|
||||
$('#searchpage').die('pageshow', arguments.callee);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function initLayerList() {
|
||||
$('#layerspage').page();
|
||||
|
||||
Reference in New Issue
Block a user