[iitcm] push layer changes to Android instead of relying on MapSettings to poll them
This commit is contained in:
13
code/boot.js
13
code/boot.js
@ -561,6 +561,19 @@ window.setupLayerChooserApi = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
var _update = window.layerChooser._update;
|
||||||
|
window.layerChooser._update = function() {
|
||||||
|
// update layer menu in IITCm
|
||||||
|
try {
|
||||||
|
if(typeof android != 'undefined')
|
||||||
|
window.layerChooser.getLayers();
|
||||||
|
} catch(e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
// call through
|
||||||
|
return _update.apply(this, arguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,6 @@ public class IITC_MapSettings implements OnItemSelectedListener, OnItemClickList
|
|||||||
|
|
||||||
public void onBootFinished() {
|
public void onBootFinished() {
|
||||||
mLoading = false;
|
mLoading = false;
|
||||||
updateLayers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -279,10 +278,4 @@ public class IITC_MapSettings implements OnItemSelectedListener, OnItemClickList
|
|||||||
}
|
}
|
||||||
mOverlayLayers.notifyDataSetChanged();
|
mOverlayLayers.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateLayers() {
|
|
||||||
if (!mLoading) {
|
|
||||||
mIitc.getWebView().loadUrl("javascript: window.layerChooser.getLayers()");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user