var a="");
}
return false;
}
);
var bounds = new OpenLayers.Bounds(576843.018,315571.929,597687.093,338587.016).transform(stereo70,geographic);
var initialZoomBounds=new OpenLayers.Bounds(576843.018,315571.929,597687.093,338587.016).transform(stereo70,geographic);
highlightStyle=new OpenLayers.Style({
strokeWidth : '3',
strokeColor : '#3300CC',
strokeOpacity : '0.7',
strokeDashstyle : 'solid',
fillColor : '#3399CC',
fillOpacity : '0.6',
pointRadius : '6'
});
var options = {
controls: [],
maxExtent: bounds,
resolutions:[89.98686607710147, 44.993433038550734, 22.496716519275367, 11.248358259637683, 5.624179129818842, 2.812089564909421, 1.4060447824547104, 0.7030223912273552, 0.3515111956136776, 0.1757555978068388,0.0878777989034194],
// maxResolution: 1024.98046875,
maxResolution: 256,
projection: epsg,
units: 'm'
};
map = new OpenLayers.Map( options);
if ("9" =='7'){
zoomMax=7;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=7;
}
}
if ("9" =='1'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='2'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='3'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='5'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='6'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='8'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='9'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='10'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='11'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
if ("9" =='4'){
zoomMax=9;
map.isValidZoomLevel = function (zoomLevel) {
return zoomLevel>=0 && zoomLevel<=9;
}
}
OpenLayers.Util.onImageLoadErrorColor = "transparent";
map.addControl(new OpenLayers.Control.MousePosition( {id: "ll_mouse", formatOutput: formatLonlats} ));
insertBaseLayer();
if("9" == 6)
radalert("Revizuirea Planului Urbanistic General este în etapa de documentare si elaborare a studiilor de fundamentare. Cerintele si optiunile publicului sunt obtinute de elaboratorul documentatiei de urbanism prin metode de cercetare sociologică relevante pentru obiectivele propuse.", 500, 170, "");
createRasterLayerX(0, "9", "Terenuri", "Proxy.aspx", "V_PMB_LIMITA_TEREN", "pmb", "1", "5000", "cbLegenda" + "V_PMB_LIMITA_TEREN","badabum", "");
if(untiled[0]) untiled[0].setVisibility(false);
untiled[0].googleEarth = '';
untiled[0].cucuRucu = '1'; createRasterLayerX(1, "9", "Parcele", "Proxy.aspx", "V_PR_PARCELE", "pmb", "1", "5000", "cbLegenda" + "V_PR_PARCELE","badabum", "");
if(untiled[1]) untiled[1].setVisibility(false);
untiled[1].googleEarth = '';
untiled[1].cucuRucu = '1'; createRasterLayerX(2, "9", "Hidrografie", "Proxy.aspx", "V_PMB_HIDROGRAFIE", "pmb", "1", "50000000", "cbLegenda" + "V_PMB_HIDROGRAFIE","badabum", "");
if(untiled[2]) untiled[2].setVisibility(false);
untiled[2].googleEarth = '';
untiled[2].cucuRucu = '1'; createRasterLayerX(3, "9", "Artere", "Proxy.aspx", "V_PMB_ARTERE", "pmb", "1", "10000", "cbLegenda" + "V_PMB_ARTERE","badabum", "");
if(untiled[3]) untiled[3].setVisibility(false);
untiled[3].googleEarth = '';
untiled[3].cucuRucu = '1'; createRasterLayerX(4, "9", "Ax trons", "Proxy.aspx", "V_AR_AX_TRONS_DENUMIRE", "pmb", "1", "50000", "cbLegenda" + "V_AR_AX_TRONS_DENUMIRE","badabum", "");
if(untiled[4]) untiled[4].setVisibility(false);
untiled[4].googleEarth = '';
untiled[4].cucuRucu = '1'; createRasterLayerX(5, "9", "Parcari", "Proxy.aspx", "V_PMB_PARCARI", "pmb", "1", "5000", "cbLegenda" + "V_PMB_PARCARI","badabum", "");
if(untiled[5]) untiled[5].setVisibility(false);
untiled[5].googleEarth = '';
untiled[5].cucuRucu = '1'; createRasterLayerX(6, "9", "Spatii verzi", "Proxy.aspx", "V_PMB_SPATII_VERZI", "pmb", "1", "50000000", "cbLegenda" + "V_PMB_SPATII_VERZI","badabum", "");
if(untiled[6]) untiled[6].setVisibility(false);
untiled[6].googleEarth = '';
untiled[6].cucuRucu = '1'; createRasterLayerX(7, "9", "Trotuare", "Proxy.aspx", "V_PMB_TROTUARE", "pmb", "1", "5000", "cbLegenda" + "V_PMB_TROTUARE","badabum", "");
if(untiled[7]) untiled[7].setVisibility(false);
untiled[7].googleEarth = '';
untiled[7].cucuRucu = '1'; createRasterLayerX(8, "9", "Alei pietonale", "Proxy.aspx", "V_PMB_ALEI_PIETONALE", "pmb", "1", "5000", "cbLegenda" + "V_PMB_ALEI_PIETONALE","badabum", "");
if(untiled[8]) untiled[8].setVisibility(false);
untiled[8].googleEarth = '';
untiled[8].cucuRucu = '1'; createRasterLayerX(9, "9", "Arbori", "Proxy.aspx", "V_PMB_ARBORI_ARBUSTI", "pmb", "1", "1000", "cbLegenda" + "V_PMB_ARBORI_ARBUSTI","badabum", "");
if(untiled[9]) untiled[9].setVisibility(false);
untiled[9].googleEarth = '';
untiled[9].cucuRucu = '1'; createRasterLayerX(10, "9", "Constructii plan", "Proxy.aspx", "V_PMB_CONSTRUCTII_PLAN", "pmb", "1", "5000", "cbLegenda" + "V_PMB_CONSTRUCTII_PLAN","badabum", "");
if(untiled[10]) untiled[10].setVisibility(false);
untiled[10].googleEarth = '';
untiled[10].cucuRucu = '1'; createRasterLayerX(11, "9", "Constructii", "Proxy.aspx", "V_PMB_CONSTRUCTII", "pmb", "1", "2500", "cbLegenda" + "V_PMB_CONSTRUCTII","badabum", "");
if(untiled[11]) untiled[11].setVisibility(false);
untiled[11].googleEarth = '';
untiled[11].cucuRucu = '1'; createOSM(12, "Harta prerenderizata");
untiled[12].googleEarth = '';
untiled[12].cucuRucu = '1'; createRasterLayerX(13, "9", "Parcuri", "Proxy.aspx", "V_PMB_PARCURI", "pmb", "1", "50000000", "cbLegenda" + "V_PMB_PARCURI","badabum", "");
if(untiled[13]) untiled[13].setVisibility(false);
untiled[13].googleEarth = '';
untiled[13].cucuRucu = '1';
createVectorLayer(14, "9", "Adrese", "Proxy.aspx", "V_PMB_ADRESE", "GEOMETRY1", "pmb.ro", "pmb", '', "1", "1000", "cbLegenda" + "V_PMB_ADRESE", 0, "", "", "False");
snapableVectorLayers.push(untiled[14]);
untiled[14].googleEarth = '';
untiled[14].cucuRucu = '1'; createRasterLayerX(15, "9", "Sectoare", "Proxy.aspx", "V_SECT_ADM", "pmb", "25000", "50000000", "cbLegenda" + "V_SECT_ADM","badabum", "");
untiled[15].googleEarth = '';
untiled[15].cucuRucu = '1';
createVectorLayer(16, "9", "Autorizatii de construire", "Proxy.aspx", "V_PR_ADRESA_AC", "GEOMETRY1", "pmb.ro", "pmb", '', "1", "10000", "cbLegenda" + "V_PR_ADRESA_AC", 0, "", "", "False");
snapableVectorLayers.push(untiled[16]);
if(untiled[16]) untiled[16].setVisibility(false);
untiled[16].googleEarth = '';
untiled[16].cucuRucu = '1';
createVectorLayer(17, "9", "Documentatii urbanism", "Proxy.aspx", "V_PMB_DOCUMENTATII_PUD", "GEOMETRY1", "pmb.ro", "pmb", '', "1", "30000", "cbLegenda" + "V_PMB_DOCUMENTATII_PUD", 0, "", "", "True");
snapableVectorLayers.push(untiled[17]);
untiled[17].googleEarth = '';
untiled[17].cucuRucu = '1';
var overCallback= {over: featureOver, out: hideTooltip};
highlightCtrl = new OpenLayers.Control.SelectFeature([untiled[14],untiled[16],untiled[17]], {
hover: true,
highlightOnly: true,
renderIntent: "temporary"
});
map.addControl(highlightCtrl);
highlightCtrl.activate();
selectControl = new OpenLayers.Control.SelectFeature([untiled[14],untiled[16],untiled[17]],{callbacks: overCallback});
map.addControl(selectControl);
selectControl.activate();
OpenLayers.loadURL("sld.xml", null, null, complete);
var sketchSymbolizers = {
"Point": {
pointRadius: 4,
graphicName: "square",
fillColor: "white",
fillOpacity: 1,
strokeWidth: 1,
strokeOpacity: 1,
strokeColor: "#333333"
},
"Line": {
strokeWidth: 3 ,
strokeOpacity: 1,
strokeColor: "#FF0000",
strokeDashstyle: "dash"
},
"Polygon": {
strokeWidth: 2,
strokeOpacity: 1,
strokeColor: "#FF0000",
fillColor: "#FF0000",
fillOpacity: 0.3
}
};
var style = new OpenLayers.Style();
style.addRules([
new OpenLayers.Rule({symbolizer: sketchSymbolizers})
]);
styleMapDraw = new OpenLayers.StyleMap({"default": style});
// build up all controls
// --------------------- Adaugare controale ---------------------
// Loading Panel
var loadingpanel = new OpenLayers.Control.LoadingPanel({displayClass: "olControlLoadingPanel"});
//map.addControl(loadingpanel);
map.addControl(new OpenLayers.Control.PanZoomBar({
position: new OpenLayers.Pixel(2, 15)
}));
map.addControl(new OpenLayers.Control.Navigation( {dragPanOptions: {enableKinetic: true}}));
map.addControl(new OpenLayers.Control.MousePosition({ div: document.getElementById('mapMousePosition') }));
map.addControl(new OpenLayers.Control.Scale('mapScale'));
map.addControl(new OpenLayers.Control.ScaleLine());
// geolocation control
var vector = new OpenLayers.Layer.Vector('vector');
map.addLayers([vector]);
var pulsate = function(feature) {
var point = feature.geometry.getCentroid(),
bounds = feature.geometry.getBounds(),
radius = Math.abs((bounds.right - bounds.left)/2),
count = 0,
grow = 'up';
var resize = function(){
if (count>16) {
clearInterval(window.resizeInterval);
}
var interval = radius * 0.03;
var ratio = interval/radius;
switch(count) {
case 4:
case 12:
grow = 'down'; break;
case 8:
grow = 'up'; break;
}
if (grow!=='up') {
ratio = - Math.abs(ratio);
}
feature.geometry.resize(1+ratio, point);
vector.drawFeature(feature);
count++;
};
window.resizeInterval = window.setInterval(resize, 50, point, radius);
};
var geolocate = new OpenLayers.Control.Geolocate({
bind: false,
geolocationOptions: {
enableHighAccuracy: false,
maximumAge: 0,
timeout: 7000
}
});
map.addControl(geolocate);
var firstGeolocation = true;
geolocate.events.register("locationupdated",geolocate,function(e) {
vector.removeAllFeatures();
var circle = new OpenLayers.Feature.Vector(
OpenLayers.Geometry.Polygon.createRegularPolygon(
new OpenLayers.Geometry.Point(e.point.x, e.point.y),
e.position.coords.accuracy/2,
40,
0
),
{},
style
);
vector.addFeatures([
new OpenLayers.Feature.Vector(
e.point,
{},
{
graphicName: 'cross',
strokeColor: '#f00',
strokeWidth: 2,
fillOpacity: 0,
pointRadius: 10
}
),
circle
]);
if (firstGeolocation) {
map.zoomToExtent(vector.getDataExtent());
pulsate(circle);
firstGeolocation = false;
this.bind = true;
}
});
geolocate.events.register("locationfailed",this,function() {
OpenLayers.Console.log('Location detection failed');
});
//overview map
var layersClone=new Array();
for(var i=0;i0)
map.removePopup(popup);
if(map.getZoom()<2){map.zoomTo(2);}
var radToolTip = $find("RadToolTip1");
var text_popup = event.text;
text_popup = text_popup.replace(/î/g,'i') ;
text_popup = text_popup.replace(/Å£/g,'t') ;
text_popup = text_popup.replace(/Ä/g,'a') ;
text_popup = text_popup.replace(/Å/g,'S') ;
text_popup = text_popup.replace(/î/g,'i') ;
text_popup = text_popup.replace(/î/g,'i') ;
radToolTip.set_text(text_popup);
radToolTip.show();
}
}
});
map.addControl(info);
info.activate();
var panel_top = new OpenLayers.Control.Panel({ defaultControl: drag_control });
map.addControl(panel_top);
panel_top.addControls([drag_control, zoomBox, navHistory.previous, navHistory.next, separator1, zoomToContextExtent, refresh_button,separator2,measureControls.line,measureControls.polygon,separator3,info,print_button]);
var cacheWrite = new OpenLayers.Control.CacheWrite({
autoActivate: true,
imageFormat: "image/png",
layers: cacheableLayers
});
map.addControl(cacheWrite);
var cacheRead = new OpenLayers.Control.CacheRead({layers: cacheableLayers});
map.addControl(cacheRead);
map.addControl(new OpenLayers.Control.Attribution());
map.addControl(graticule);
graticule.deactivate();
if(Browser.Version() >= 8) map.fractionalZoom = true;
//if((document.location.href.indexOf("#") == -1) || (document.location.href.indexOf("lat=") == -1))
map.zoomToExtent(initialZoomBounds);
map.addControl(new OpenLayers.Control.Permalink({anchor: true}));
map.render("map");
if(map.getZoomForExtent(map.getExtent())");
defaultPageView.append("Amplasament: " + (geometry.feature.data.AMPLASAMENT != null ? geometry.feature.data.AMPLASAMENT : " -") +"
");
//defaultPageView.append("An elaborare: " + (geometry.feature.data.AN_AVIZARE != null ? geometry.feature.data.AN_AVIZARE : " -") +"
");
defaultPageView.append("
Aviz:
");
defaultPageView.append("Nr: " + (geometry.feature.data.NR_AVIZ != null ? geometry.feature.data.NR_AVIZ : " -") +"
");
defaultPageView.append("Data: " + (geometry.feature.data.DATA_AVIZ != null ? geometry.feature.data.DATA_AVIZ : " -") +"
");
if (geometry.feature.data.POZA_AVIZ != null)
defaultPageView.append("Document atasat: Download
");
defaultPageView.append("
Hotarare:
");
defaultPageView.append("Nr: " + (geometry.feature.data.NR_HOTARARE != null ? geometry.feature.data.NR_HOTARARE : " -") +"
");
defaultPageView.append("Data: " + (geometry.feature.data.DATA_HOT != null ? geometry.feature.data.DATA_HOT : " -") +"
");
if (geometry.feature.data.POZA_HOTARARE != null)
defaultPageView.append("Document atasat: Download
");
defaultPageView.append("
Regulament:
");
if (geometry.feature.data.REGULAMENT != null){
if(geometry.feature.data.REGULAMENT.substr((~-geometry.feature.data.REGULAMENT.lastIndexOf(".") >>> 0) + 2)!="")
{
defaultPageView.append("Document atasat: Download
");
}else{
var winds= geometry.feature.data.REGULAMENT.toLowerCase().replace('\\\\pmbfs1','').replace(/\\/g, '/').replace('/','');
defaultPageView.append("Document atasat: Download
");
}
}
defaultPageView.append("
Plansa:
");
if (geometry.feature.data.FISIER_POZA != null){
if(geometry.feature.data.FISIER_POZA.substr((~-geometry.feature.data.FISIER_POZA.lastIndexOf(".") >>> 0) + 2)!="")
{
defaultPageView.append("Document atasat: Download
");
}else{
var winds= geometry.feature.data.FISIER_POZA.toLowerCase().replace('\\\\pmbfs1','').replace(/\\/g, '/').replace('/','');
defaultPageView.append("Document atasat: Download
");
}
}
radTabDet.show();
}
}
}
function toggleGraticule(checkbox)
{
if(checkbox.checked)
graticule.activate();
else
graticule.deactivate();
}
function openChild(file) {
childWindow=open(file,"Cauta","width=600,height=600,0,status=0,scrollbars=1,location=0");
if (childWindow.opener == null) childWindow.opener = self;
}
function handleMeasurements(event) {
var geometry = event.geometry;
var units = event.units;
var order = event.order;
var measure = event.measure;
var element = document.getElementById('mapOutput');
var out = "";
if(order == 1) {
out += "Distanta: " + measure.toFixed(3) + " " + units;
// if (map.getProjection() == epsg) {
// out += ", Great Circle Distance: " +
// calcVincenty(geometry).toFixed(3) + " km";
// }
} else {
out += "Arie: " + measure.toFixed(3) + " " + units + "2" + "sup>";
}
element.innerHTML = out;
}
function refreshMap(){
untiled[0].redraw();
untiled[1].redraw();
untiled[2].redraw();
untiled[3].redraw();
untiled[4].redraw();
untiled[5].redraw();
untiled[6].redraw();
untiled[7].redraw();
untiled[8].redraw();
untiled[9].redraw();
untiled[10].redraw();
untiled[11].redraw();
untiled[12].redraw();
untiled[13].redraw();
untiled[14].redraw();
untiled[15].redraw();
untiled[16].redraw();
untiled[17].redraw();
};
// sets the HTML provided into the nodelist element
function setHTML(response){
//document.getElementById('nodelist').innerHTML += response.responseText;
};
// shows/hide the control panel
function toggleControlPanel(event){
var toolbar = document.getElementById("toolbar");
if (toolbar.style.display == "none") {
toolbar.style.display = "block";
}
else {
toolbar.style.display = "none";
}
event.stopPropagation();
map.updateSize();
}
function selectFeature(id, idcol, table)
{
var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
if (tooltip) {
tooltip.hide();
}
if(map.getLayerIndex(selection_layer)!=-1)
map.removeLayer(selection_layer);
selection_layer = new OpenLayers.Layer.Vector(table, {
strategies: [new OpenLayers.Strategy.BBOX()],
displayInLayerSwitcher: false,
projection: geographic,
protocol: new OpenLayers.Protocol.WFS({
url: "Proxy.aspx?zx_xz=1&xz_zx=0&",
featureType: table,
//extractAttributes:true,
features: "GEOMETRY1",
srsName: epsg,
featureNS: "pmb.ro",
featurePrefix: "pmb",
geometryName: "GEOMETRY1"
}),
styleMap: new OpenLayers.StyleMap({
strokeWidth: 6,
strokeColor: "#008888",
fillColor: "#00DDDD",
fillOpacity: 0.5,
pointerEvents: "visiblePainted",
pointRadius : '3'
}),
//commitReport: goToExtent,
filter: new OpenLayers.Filter.Logical({
type: OpenLayers.Filter.Logical.OR,
filters: [
new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: idcol,
value: id
})
]
})});
map.addLayer(selection_layer);
selection_layer.events.register("loadend", selection_layer, goToExtent);
if(map.popups.length>0)
map.removePopup(popup);
selection_layer.redraw();
document.getElementById('deselecteaza').disabled = false;
}
function selectFeatureBBox(id, idcol, table,xmin,ymin,xmax,ymax, zoom)
{
searchResultBounds=new OpenLayers.Bounds(xmin,ymin,xmax,ymax);
var bboxzoom = map.getZoomForExtent(searchResultBounds);
if(bboxzoomzoomMax){
zoom=zoomMax;
}
map.zoomTo(zoom);
var originalZoom=map.getZoom();
var zoomLevel=map.getZoom();
var mapbounds=map.getExtent();
map.centerLayerContainer(searchResultBounds.getCenterLonLat());
map.panTo(searchResultBounds.getCenterLonLat());
selected_zoom = zoom;
selectFeature(id, idcol, table);
}
function openChild(file) {
childWindow=open(file,"Cauta","width=600,height=600,0,status=0,scrollbars=1,location=0");
if (childWindow.opener == null) childWindow.opener = self;
}
function goToExtent()
{
//map.zoomToExtent(selection_layer.getDataExtent());
//var zoom = map.getZoomForExtent(selection_layer.getDataExtent());
//if(selected_zoom!=0)
//{
// if(selected_zoom>zoom) selected_zoom = zoom;
// map.zoomTo(selected_zoom);
// selected_zoom=0;
//}
}
function setPalette(mode){
if (mode == '') {
untiled[0].mergeNewParams({
palette: null
});
untiled[1].mergeNewParams({
palette: null
});
untiled[2].mergeNewParams({
palette: null
});
untiled[3].mergeNewParams({
palette: null
});
untiled[4].mergeNewParams({
palette: null
});
untiled[5].mergeNewParams({
palette: null
});
untiled[6].mergeNewParams({
palette: null
});
untiled[7].mergeNewParams({
palette: null
});
untiled[8].mergeNewParams({
palette: null
});
untiled[9].mergeNewParams({
palette: null
});
untiled[10].mergeNewParams({
palette: null
});
untiled[11].mergeNewParams({
palette: null
});
untiled[12].mergeNewParams({
palette: null
});
untiled[13].mergeNewParams({
palette: null
});
untiled[14].mergeNewParams({
palette: null
});
untiled[15].mergeNewParams({
palette: null
});
untiled[16].mergeNewParams({
palette: null
});
untiled[17].mergeNewParams({
palette: null
});
}
else {
untiled[0].mergeNewParams({
palette: mode
});
untiled[1].mergeNewParams({
palette: mode
});
untiled[2].mergeNewParams({
palette: mode
});
untiled[3].mergeNewParams({
palette: mode
});
untiled[4].mergeNewParams({
palette: mode
});
untiled[5].mergeNewParams({
palette: mode
});
untiled[6].mergeNewParams({
palette: mode
});
untiled[7].mergeNewParams({
palette: mode
});
untiled[8].mergeNewParams({
palette: mode
});
untiled[9].mergeNewParams({
palette: mode
});
untiled[10].mergeNewParams({
palette: mode
});
untiled[11].mergeNewParams({
palette: mode
});
untiled[12].mergeNewParams({
palette: mode
});
untiled[13].mergeNewParams({
palette: mode
});
untiled[14].mergeNewParams({
palette: mode
});
untiled[15].mergeNewParams({
palette: mode
});
untiled[16].mergeNewParams({
palette: mode
});
untiled[17].mergeNewParams({
palette: mode
});
}
/////////////////////////////////////////////////////////////////////////////////////
}
// Set a style for the given layer:
function setLayerStyle(layerName, index, layer)
{
//alert('set style');
var sldLayerName = sld.namedLayers[layerName];
if(sldLayerName)
{
var customStyle=sld.namedLayers[layerName].userStyles[index];
layer.styleMap.styles['default']=customStyle;
layer.styleMap.styles['temporary']=highlightStyle;
layer.redraw();
}
}
function complete(req)
{
//alert('complete fct');
sld = formatSLD.read(req.responseXML || req.responseText);
//parcurg vectorii
setLayerStyle("Adrese",0,untiled[14]);
setLayerStyle("Autorizatii de construire",0,untiled[16]);
setLayerStyle("Documentatii urbanism",0,untiled[17]);
}
function setWidth(size){
var mapDiv = document.getElementById('map');
var wrapper = document.getElementById('wrapper');
if (size == "auto") {
// reset back to the default value
mapDiv.style.width = null;
wrapper.style.width = null;
}
else {
mapDiv.style.width = size + "px";
wrapper.style.width = size + "px";
}
// notify OL that we changed the size of the map div
map.updateSize();
}
function setHeight(size){
var mapDiv = document.getElementById('map');
if (size == "auto") {
// reset back to the default value
mapDiv.style.height = null;
}
else {
mapDiv.style.height = size + "px";
}
// notify OL that we changed the size of the map div
map.updateSize();
}
function updateFilter(){
}
function resetFilter() {
}
function mergeNewParams(params){
untiled[0].mergeNewParams(params);
untiled[1].mergeNewParams(params);
untiled[2].mergeNewParams(params);
untiled[3].mergeNewParams(params);
untiled[4].mergeNewParams(params);
untiled[5].mergeNewParams(params);
untiled[6].mergeNewParams(params);
untiled[7].mergeNewParams(params);
untiled[8].mergeNewParams(params);
untiled[9].mergeNewParams(params);
untiled[10].mergeNewParams(params);
untiled[11].mergeNewParams(params);
untiled[12].mergeNewParams(params);
untiled[13].mergeNewParams(params);
untiled[14].mergeNewParams(params);
untiled[15].mergeNewParams(params);
untiled[16].mergeNewParams(params);
untiled[17].mergeNewParams(params);
}
function getColors()
{
alert(untiled[0].params.LAYERS);
alert('Culoare '+untiled[0].features[0].attributes.id_af_plan);
//for (var pr in untiled[0].features[0].attributes)
// {
// alert(pr);
// }
}
function clearSelection()
{
if(map.getLayerIndex(selection_layer)!=-1)
map.removeLayer(selection_layer);
document.getElementById('deselecteaza').disabled = "disabled";
}
function featureOver(feature) {
var radToolTip = $find("RadToolTip1");
if(!radToolTip.isVisible())
{
var fname='';
var title = '';
if(feature.layer.name=='Adrese'){
title = 'Adrese';
fname = fname + '';
fname = fname + "- Artera: ";
if(feature.attributes.NUME_ARTERA!=null)
fname = fname + feature.attributes.NUME_ARTERA +"
";
else
fname = fname + "- ";
fname = fname + "- Nr postal: ";
if(feature.attributes.NR_POSTAL!=null)
fname = fname + feature.attributes.NR_POSTAL +"
";
else
fname = fname + "- ";
fname = fname + "
";}
if(feature.layer.name=='Autorizatii de construire'){
title = 'Autorizatii de construire';
fname = fname + '';
fname = fname + "- Data autorizatie: ";
if(feature.attributes.DATA_STRING!=null)
fname = fname + feature.attributes.DATA_STRING +"
";
else
fname = fname + "- ";
fname = fname + "- Tip artera: ";
if(feature.attributes.TIP_ARTERA!=null)
fname = fname + feature.attributes.TIP_ARTERA +"
";
else
fname = fname + "- ";
fname = fname + "- Denumirea arterei: ";
if(feature.attributes.ARTERA_BDU!=null)
fname = fname + feature.attributes.ARTERA_BDU +"
";
else
fname = fname + "- ";
fname = fname + "- Numar postal: ";
if(feature.attributes.NR_POSTAL!=null)
fname = fname + feature.attributes.NR_POSTAL +"
";
else
fname = fname + "- ";
fname = fname + "- Sector: ";
if(feature.attributes.SECT!=null)
fname = fname + feature.attributes.SECT +"
";
else
fname = fname + "- ";
fname = fname + "- Beneficiar Test: ";
if(feature.attributes.BENEFICIAR!=null)
fname = fname + feature.attributes.BENEFICIAR +"
";
else
fname = fname + "- ";
fname = fname + "- Functiune: ";
if(feature.attributes.FUNCTIUNE!=null)
fname = fname + feature.attributes.FUNCTIUNE +"
";
else
fname = fname + "- ";
fname = fname + "
";}
if(feature.layer.name=='Documentatii urbanism'){
title = 'Documentatii urbanism';
fname = fname + '';
fname = fname + "- Denumire: ";
if(feature.attributes.DENUMIRE!=null)
fname = fname + feature.attributes.DENUMIRE +"
";
else
fname = fname + "- ";
fname = fname + "- Stare: ";
if(feature.attributes.DENUMIRE_STARE!=null)
fname = fname + feature.attributes.DENUMIRE_STARE +"
";
else
fname = fname + "- ";
fname = fname + "- Etapa: ";
if(feature.attributes.DENUMIRE_ETAPA!=null)
fname = fname + feature.attributes.DENUMIRE_ETAPA +"
";
else
fname = fname + "- ";
fname = fname + "- Data expirarii etapei: ";
if(feature.attributes.DATA_SFARSIT_FORMATATA!=null)
fname = fname + feature.attributes.DATA_SFARSIT_FORMATATA +"
";
else
fname = fname + "- ";
fname = fname + "- Mentiuni: ";
if(feature.attributes.MENTIUNI!=null)
fname = fname + feature.attributes.MENTIUNI +"
";
else
fname = fname + "- ";
fname = fname + "
";}
var xy = this.map.getControl('ll_mouse').lastXy || new OpenLayers.Pixel(0,0);
showTooltip(fname,title,xy.x,xy.y, feature);
}
}
function showTooltip(ttText, title,x,y,feature) {
var o = document.getElementById('tooltip');
o.style.left = x + 'px';
o.style.top = y + 'px';
var radToolTip = $find("RadToolTip2");
radToolTip.hide();
radToolTip.set_text(ttText);
radToolTip.set_title(title);
radToolTip.show();
}
function hideTooltip()
{
var radToolTip = $find("RadToolTip2");
radToolTip.hide();
}
//non-OL-related functions
function getViewport() {
var e = window, a = 'inner';
if ( !( 'innerWidth' in window ) ) {
a = 'client';
e = document.documentElement || document.body;
}
return { width : e[ a+'Width' ], height : e[ a+'Height' ] }
}
function onPopupClose(feature) {
selectControl.unselect(feature);
}
function onFeatureUnselect(feature) {
if(feature.popup!=null)
{
map.removePopup(feature.popup);
feature.popup.destroy();
//feature.attributes.poppedup = false;
feature.popup = null;
}
}
// insert base layer invizibil in legenda
function insertBaseLayer() {
var baseLayerOptions = {
isBaseLayer: true,
displayInLayerSwitcher: true
};
var fake = new OpenLayers.Layer('fake', baseLayerOptions);
map.addLayer(fake);
}
// afisare lat/lon in harta
function formatLonlats(lonLat) {
var lat = lonLat.lat;
var lg = lonLat.lon;
var ns = OpenLayers.Util.getFormattedLonLat(lat);
var ew = OpenLayers.Util.getFormattedLonLat(lg,'lon');
return ns + ', ' + ew + ' (' + (Math.round(lat * 10000) / 10000) + ', ' + (Math.round(lg * 10000) / 10000) + ')';
}
var b = "";