//"; GEvent.addDomListener(this.gridLogoDiv, "click", function() { map.LocaPointGrid.onoff(); }); this.map_.getContainer().appendChild(this.gridLogoDiv); GEvent.addListener(map, 'movestart', function() {map.LocaPointGrid.remove();} ); GEvent.addListener(map, 'moveend', function() {map.LocaPointGrid.redraw_manual();} ); GEvent.addListener(map, 'zoomend', function(oldZoomLevel, newZoomLevel) {map.LocaPointGrid.redraw_manual();} ); //Attach to resize //if (window.addEventListener) { // window.addEventListener("resize", map.LocaPointGrid.redraw_manual, false); //}else if (window.attachEvent) { // window.attachEvent("on"+"resize", map.LocaPointGrid.redraw_manual.resize); //} this.enableflag = false; map.LocaPointGrid.redraw_manual(); } LocaPointGrid.prototype.onoff = function() { if(this.enableflag){ this.enableflag=false; }else{ this.enableflag=true; } this.redraw_manual(); } LocaPointGrid.prototype.enable = function() { this.enableflag = true; this.redraw_manual(); } LocaPointGrid.prototype.disable = function() { this.enableflag = false; this.redraw_manual(); } LocaPointGrid.prototype.remove = function() { this.lpgridcanvas.innerHTML=""; this.lpgridrulercanvas.innerHTML=""; } LocaPointGrid.prototype.copy = function() { return new LocaPointGrid(); } LocaPointGrid.prototype.redraw = function(force) { return; } LocaPointGrid.prototype.redraw_manual = function(manualLPlevel) { this.remove(); if(this.enableflag==false){ return; } //Bounds in map pane var bnds = this.map_.getBounds(); if(bnds.isFullLng()){ return; } //min and max x and y pixel values for Map DIV for visual range var pbl = this.map_.fromLatLngToDivPixel(bnds.getSouthWest()); var ptr = this.map_.fromLatLngToDivPixel(bnds.getNorthEast()); var VisualRangeTL = this.map_.fromContainerPixelToLatLng(new GPoint(0,0)); //var VisualRangeBR = this.map_.fromContainerPixelToLatLng(new GPoint(ptr.x - pbl.x, pbl.y - ptr.y)); var mapsize = map.getSize(); var VisualRangeBR = this.map_.fromContainerPixelToLatLng(new GPoint(mapsize.width, mapsize.height)); if(bnds.isFullLng()){ VisualRangeBR = new GLatLng(-180, 180+360+360, true); }else if (VisualRangeTL.lng() > VisualRangeBR.lng()){//over INTL' date line VisualRangeBR = new GLatLng(VisualRangeBR.lat(), VisualRangeBR.lng()+360, true); } //alert((bnds.isFullLng()?("Full Lat"):(" Not FUll Lat")) + "\n" // + bnds.getSouthWest().lng() + " to " + bnds.getNorthEast().lng() + "\n" // + pbl.x + " to " + ptr.x + "\n" // + VisualRangeTL.lng() + " to " + VisualRangeBR.lng() // ); var level = manualLPlevel-0; if(level!=1 && level!=2 && level!=3 && level!=4 && level!=5 && level!=6){ level = this.getLPGridAutoLevel(); } this.DrawLocaPointGrid(VisualRangeTL, VisualRangeBR, level); return; } LocaPointGrid.prototype.AppendDiv = function(left, top, width, height,bgcolor, color, opacity){ var d = document.createElement("DIV"); var s = d.style; s.position = "absolute"; s.overflow = "hidden"; s.left = left + "px"; s.top = top + "px"; s.width = (width!=""?width:"1")+"px"; s.height = (height!=""?height:"1")+"px"; s.backgroundColor = (bgcolor!=""?bgcolor:"#8888FF"); s.color = (color!=""?color:"#FFFFFF"); s.opacity = opacity/10; s.filter = 'alpha(opacity=' + opacity*10 + ')'; this.lpgridcanvas.appendChild(d); } LocaPointGrid.prototype.AppendDivRuler = function(left, top, width, height,bgcolor, color, opacity, htmltext, Vallign, Hallign){ var d = document.createElement("DIV"); var s = d.style; s.position = "absolute"; s.overflow = "hidden"; s.left = left + "px"; s.top = top + "px"; s.width = (width!=""?width:"1")+"px"; s.height = (height!=""?height:"1")+"px"; s.backgroundColor = (bgcolor!=""?bgcolor:"#8888FF"); s.color = (color!=""?color:"#FFFFFF"); s.fontFamily='Arial'; s.fontSize='x-small'; //s.font = "6px Arial; //'Courier New', Courier, monospace"; s.opacity = opacity/10; s.filter = 'alpha(opacity=' + opacity*10 + ')'; d.innerHTML = "
" + htmltext + " |