var vmsLoc = Array (); vmsLoc ["VMS2"] = "52.2520142,21.0145283"; vmsLoc ["VMS5"] = "52.1906891,21.0474319"; vmsLoc ["VMS1"] = "52.2795982,20.9924240"; vmsLoc ["VMS3"] = "52.2188148,21.0458717"; vmsLoc ["VMS4"] = "52.1940155,21.0554962"; function getVMS () { _ajax_connL = new XHConn(); _ajax_connL.connect('data/vms.js',"GET",'a=a',parseVMS); } function switchVMS () { var button = document.getElementById ('m_vms'); switchButton (button); if (buttonIsOn(button)){ getVMS(); } else { mapobject.hideLayerByName('vms'); } } function parseVMS (ans) { // hideAllLayers(); vms = ans.responseText.parseJSON(); var icons1 = new Array (); for (var i=0; i < vms.length; i++){ icons1[i] = new MapgoIcon(); d = '
'; d += '

Tablica zmiennej treści

'; if (typeof (vms[i].text) == 'undefined') { } else { if (vms[i].text !== null){ d += '

'+vms[i].text+'

'; } } if (vms[i].Graphic1 != null){ d+= ''; } if (vms[i].Graphic2 != null){ d+= ''; } if (vms[i].Graphic3 != null){ d+= ''; } d += '
'; var loc = vmsLoc[vms[i].id]; icons1[i].show_tip_state = 1; icons1[i].descr = d; icons1[i].tip_width = 255; icons1[i].tip_height = 150; icons1[i].image = 'gfx/ico_tab.png'; icons1[i].width = 29; icons1[i].height = 27; icons1[i].lon=loc.split (',')[1]; icons1[i].lat=loc.split (',')[0]; } mapobject.hideLayerByName('vms'); addIconsToMap(icons1,"vms"); var layer=mapobject.searchLayer("vms"); mapobject.positionMap(layer.features); return false; }