Mercurial > hg > ChinaGisRestApi
changeset 237:35c3d0ce2914
show line and polygon-layer
author | fknauft |
---|---|
date | Tue, 06 Sep 2011 09:52:15 +0200 |
parents | 52aa589f4c4d |
children | aa6d3137a92f |
files | gis_gui/blocks/map.html.pt gis_gui/blocks/map.js |
diffstat | 2 files changed, 21 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/gis_gui/blocks/map.html.pt Mon Sep 05 11:38:20 2011 +0200 +++ b/gis_gui/blocks/map.html.pt Tue Sep 06 09:52:15 2011 +0200 @@ -54,8 +54,9 @@ <p><input type="button" class="layer_add_button" value="Add layer" /></p> <p><input type="button" class="map_update_button" value="Update map" /><br /> - <input type="button" class="map_newwindow_button" value="Open map in new Window" /></p> - + <input type="button" class="map_reload_button" value="Reload map" /><br /> </p> + <!-- <input type="button" class="map_newwindow_button" value="Open map in new Window" /></p> + --> <p><input type="button" class="map_save_button" value="Save map" /></p> </div>
--- a/gis_gui/blocks/map.js Mon Sep 05 11:38:20 2011 +0200 +++ b/gis_gui/blocks/map.js Tue Sep 06 09:52:15 2011 +0200 @@ -21,7 +21,7 @@ //params = block.readLayerParams(); // load map - block.updateMap(be,params); + var map=block.updateMap(be,params); // add layer button $(be).find(".layer_add_button").click(function() { @@ -33,16 +33,22 @@ $(be).find(".map_update_button").click(function () { console.debug("map update"); params = block.readMapParams(); - block.updateMap(be,params); + map=block.updateMap(be,params); }); // new window button - $(be).find(".map_newwindow_button").click(function () { + /* $(be).find(".map_newwindow_button").click(function () { console.debug("map in new window"); params = block.readMapParams(); var newWindow = window.open("blocks/map_newwindow.html"); - block.updateMap(newWindow.document.getElementById("map_box"),params); + map=block.updateMap(newWindow.document.getElementById("map_box"),params); }); - // save button + */ + // reload button + $(be).find(".map_reload_button").click(function () { + console.debug("reload map"); + block.reloadMap(map); + }); + // save button $(be).find(".map_save_button").click(function () { console.debug("map save. this=",this," block=",block); params = block.readMapParams(be,params); @@ -111,7 +117,7 @@ console.debug("del layer ",layerIdx); params = block.deleteMapLayer(layerIdx); block.showMapParams(elem, params); - block.updateMap(elem, params); + var map = block.updateMap(elem, params); }); } } @@ -135,10 +141,14 @@ return params; }; +guiBlocks.Block.prototype.reloadMap = function(map) { + map.refresh(); +}; + guiBlocks.Block.prototype.updateMap = function(elem,map_params) { //************ - //alert("bin in updateMap:" + elem + ", " + map_params) + console.debug("bin in updateMap:" + elem + ", " + map_params); //************* if (elem == null) { @@ -203,6 +213,7 @@ } }); } + return map; }; guiBlocks.Block.prototype.addMapLayer = function(elem,params) {