/* start module: map */
$pyjs['loaded_modules']['map'] = function (__mod_name__) {
	if($pyjs['loaded_modules']['map']['__was_initialized__']) return $pyjs['loaded_modules']['map'];
	var $m = $pyjs['loaded_modules']['map'];
	$m['__repr__'] = function() { return '<module: map>'; };
	$m['__was_initialized__'] = true;
	if ((__mod_name__ === null) || (typeof __mod_name__ == 'undefined')) __mod_name__ = 'map';
	$m['__name__'] = __mod_name__;


	$m['Calendar'] = $p['___import___']('pyjamas.ui.Calendar.Calendar', null, null, false);
	$m['DateField'] = $p['___import___']('pyjamas.ui.Calendar.DateField', null, null, false);
	$m['RootPanel'] = $p['___import___']('pyjamas.ui.RootPanel.RootPanel', null, null, false);
	$m['VerticalPanel'] = $p['___import___']('pyjamas.ui.VerticalPanel.VerticalPanel', null, null, false);
	$m['HorizontalPanel'] = $p['___import___']('pyjamas.ui.HorizontalPanel.HorizontalPanel', null, null, false);
	$m['SimplePanel'] = $p['___import___']('pyjamas.ui.SimplePanel.SimplePanel', null, null, false);
	$m['FlowPanel'] = $p['___import___']('pyjamas.ui.FlowPanel.FlowPanel', null, null, false);
	$m['DisclosurePanel'] = $p['___import___']('pyjamas.ui.DisclosurePanel.DisclosurePanel', null, null, false);
	$m['TabPanel'] = $p['___import___']('pyjamas.ui.TabPanel.TabPanel', null, null, false);
	$m['Grid'] = $p['___import___']('pyjamas.ui.Grid.Grid', null, null, false);
	$m['Frame'] = $p['___import___']('pyjamas.ui.Frame.Frame', null, null, false);
	$m['TextBox'] = $p['___import___']('pyjamas.ui.TextBox.TextBox', null, null, false);
	$m['TextArea'] = $p['___import___']('pyjamas.ui.TextArea.TextArea', null, null, false);
	$m['HTML'] = $p['___import___']('pyjamas.ui.HTML.HTML', null, null, false);
	$m['Label'] = $p['___import___']('pyjamas.ui.Label.Label', null, null, false);
	$m['CheckBox'] = $p['___import___']('pyjamas.ui.CheckBox.CheckBox', null, null, false);
	$m['ListBox'] = $p['___import___']('pyjamas.ui.ListBox.ListBox', null, null, false);
	$m['Button'] = $p['___import___']('pyjamas.ui.Button.Button', null, null, false);
	$m['PopupPanel'] = $p['___import___']('pyjamas.ui.PopupPanel.PopupPanel', null, null, false);
	$m['KeyboardHandler'] = $p['___import___']('pyjamas.ui.KeyboardListener.KeyboardHandler', null, null, false);
	$m['Tree'] = $p['___import___']('pyjamas.ui.Tree.Tree', null, null, false);
	$m['TreeItem'] = $p['___import___']('pyjamas.ui.Tree.TreeItem', null, null, false);
	$m['Image'] = $p['___import___']('pyjamas.ui.Image.Image', null, null, false);
	$m['HasAlignment'] = $p['___import___']('pyjamas.ui.HasAlignment', null, null, false);
	$m['MenuBar'] = $p['___import___']('pyjamas.ui.MenuBar.MenuBar', null, null, false);
	$m['MenuItem'] = $p['___import___']('pyjamas.ui.MenuItem.MenuItem', null, null, false);
	$m['Widget'] = $p['___import___']('pyjamas.ui.Widget.Widget', null, null, false);
	$m['Hyperlink'] = $p['___import___']('pyjamas.ui.Hyperlink.Hyperlink', null, null, false);
	$m['Window'] = $p['___import___']('pyjamas.Window', null, null, false);
	$m['Timer'] = $p['___import___']('pyjamas.Timer.Timer', null, null, false);
	$m['JSONProxy'] = $p['___import___']('pyjamas.JSONService.JSONProxy', null, null, false);
	$m['History'] = $p['___import___']('pyjamas.History', null, null, false);
	$m['DOM'] = $p['___import___']('pyjamas.DOM', null, null, false);
	$m['prnt'] = $p['___import___']('prnt.prnt', null, null, false);
	$m['Map'] = $p['___import___']('pyjamas.gmaps.Map.Map', null, null, false);
	$m['MapTypeId'] = $p['___import___']('pyjamas.gmaps.Map.MapTypeId', null, null, false);
	$m['MapOptions'] = $p['___import___']('pyjamas.gmaps.Map.MapOptions', null, null, false);
	$m['LatLng'] = $p['___import___']('pyjamas.gmaps.Base.LatLng', null, null, false);
	$m['ContextMenuPopupPanel'] = $p['___import___']('pyjamas.ui.ContextMenuPopupPanel.ContextMenuPopupPanel', null, null, false);
	$m['date'] = $p['___import___']('datetime.date', null, null, false);
	$m['time'] = $p['___import___']('datetime.time', null, null, false);
	$m['datetime'] = $p['___import___']('datetime.datetime', null, null, false);
	$m['timedelta'] = $p['___import___']('datetime.timedelta', null, null, false);
	$m['DissolvingPopup'] = $p['___import___']('DissolvingPopup.DissolvingPopup', null, null, false);
	$m['JsonHandler'] = $p['___import___']('util.JsonHandler', null, null, false);
	$m['redirect'] = $p['___import___']('util.redirect', null, null, false);
	$m['MenuCmd'] = $p['___import___']('util.MenuCmd', null, null, false);
	$m['HTMLFlowPanel'] = $p['___import___']('util.HTMLFlowPanel', null, null, false);
	$m['SearchPopup'] = $p['___import___']('util.SearchPopup', null, null, false);
	$m['Map'] = $p['___import___']('pyjamas.gmaps.Map.Map', null, null, false);
	$m['MapTypeId'] = $p['___import___']('pyjamas.gmaps.Map.MapTypeId', null, null, false);
	$m['MapOptions'] = $p['___import___']('pyjamas.gmaps.Map.MapOptions', null, null, false);
	$m['client'] = $m['JSONProxy']('/json/', $p['list'](['mappa_layer']));
	$m['list_to_point_array'] = function(l) {
		var $iter1_nextval,$iter1_type,$iter1_iter,$iter1_array,y,x,$iter1_idx;
punti = Array();
		$iter1_iter = l;
		$iter1_nextval=$p['__iter_prepare']($iter1_iter,false);
		while (typeof($p['__wrapped_next']($iter1_nextval)['$nextval']) != 'undefined') {
			var $tupleassign1 = $p['__ass_unpack']($iter1_nextval['$nextval'], 2, null);
			y = $tupleassign1[0];
			x = $tupleassign1[1];
punti.push(new $wnd['google'].maps.LatLng(x, y));
		}
		return (typeof punti == "undefined"?$m['punti']:punti);
	};
	$m['list_to_point_array']['__name__'] = 'list_to_point_array';

	$m['list_to_point_array']['__bind_type__'] = 0;
	$m['list_to_point_array']['__args__'] = [null,null,['l']];
	$m['MapPanel'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(owner) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				owner = arguments[1];
			}
			var map,options,func;
			$m['SimplePanel']['__init__'](self);
			self['owner'] = owner;
			self['owner']['add'](self);
			self['setSize']('100%', '100%');
			self['layers'] = $p['list']([]);
			self['layer_panels'] = $p['list']([]);
			self['right_click_options'] = $p['list']([]);
			options = $pyjs_kwargs_call(null, $m['MapOptions'], null, null, [{'zoom':12, 'center':$m['LatLng'](41.892055, 12.483559), 'mapTypeId':$p['getattr']($m['MapTypeId'], 'ROADMAP')}]);
			self['map'] = $m['Map'](self['getElement'](), options);
			map = $p['getattr'](self, 'map');
			func = $p['getattr'](self, 'onRightClick');
			self['addStyleName']('pyjsmapid');

			$wnd['google'].maps.event.addListener(map, 'rightclick', function(event) {
				var lat = event.latLng.lat();
    		var lng = event.latLng.lng();
				func(lat, lng, event.pixel.x, event.pixel.y);
			});
		
			self['open_bubble'] = null;
			return null;
		}
	, 1, [null,null,['self'],['owner']]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('addRightClickOption', function(option, callback) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				option = arguments[1];
				callback = arguments[2];
			}

			self['right_click_options']['append']($p['tuple']([option, callback]));
			return null;
		}
	, 1, [null,null,['self'],['option'],['callback']]);
		$cls_definition['addRightClickOption'] = $method;
		$method = $pyjs__bind_method2('rightClickHandlerFactory', function(cb, lat, lng) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				cb = arguments[1];
				lat = arguments[2];
				lng = arguments[3];
			}
			var handler;
			handler = function() {

				cb(lat, lng);
				return null;
			};
			handler['__name__'] = 'handler';

			handler['__bind_type__'] = 0;
			handler['__args__'] = [null,null];
			return handler;
		}
	, 1, [null,null,['self'],['cb'],['lat'],['lng']]);
		$cls_definition['rightClickHandlerFactory'] = $method;
		$method = $pyjs__bind_method2('onRightClick', function(lat, lng, x, y) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				lat = arguments[1];
				lng = arguments[2];
				x = arguments[3];
				y = arguments[4];
			}
			var opt,$iter2_nextval,$iter2_type,$iter2_iter,$add3,menu,$add2,$iter2_idx,popup,$add4,cb,$add1,my,mx,$iter2_array;
			mx = $m['DOM']['getAbsoluteLeft'](self['getElement']());
			my = $m['DOM']['getAbsoluteTop'](self['getElement']());
			menu = $pyjs_kwargs_call(null, $m['MenuBar'], null, null, [{'vertical':true}]);
			$iter2_iter = $p['getattr'](self, 'right_click_options');
			$iter2_nextval=$p['__iter_prepare']($iter2_iter,false);
			while (typeof($p['__wrapped_next']($iter2_nextval)['$nextval']) != 'undefined') {
				var $tupleassign2 = $p['__ass_unpack']($iter2_nextval['$nextval'], 2, null);
				opt = $tupleassign2[0];
				cb = $tupleassign2[1];
				menu['addItem'](opt, $m['MenuCmd'](self['rightClickHandlerFactory'](cb, lat, lng)));
			}
			popup = $m['ContextMenuPopupPanel'](menu);
			popup['showAt']($p['__op_add']($add1=x,$add2=mx), $p['__op_add']($add3=y,$add4=my));
			return null;
		}
	, 1, [null,null,['self'],['lat'],['lng'],['x'],['y']]);
		$cls_definition['onRightClick'] = $method;
		$method = $pyjs__bind_method2('relayout', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

$wnd['google'].maps.event.trigger(self.map, "resize");
		}
	, 1, [null,null,['self']]);
		$cls_definition['relayout'] = $method;
		$method = $pyjs__bind_method2('replace_bubble', function(new_bubble) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				new_bubble = arguments[1];
			}

			if ($p['bool'](($p['getattr'](self, 'open_bubble') !== null))) {
				self['open_bubble']['closeBubble']();
			}
			self['open_bubble'] = new_bubble;
			return null;
		}
	, 1, [null,null,['self'],['new_bubble']]);
		$cls_definition['replace_bubble'] = $method;
		$method = $pyjs__bind_method2('addLayerPanel', function(lp) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				lp = arguments[1];
			}

			self['layer_panels']['append'](lp);
			return null;
		}
	, 1, [null,null,['self'],['lp']]);
		$cls_definition['addLayerPanel'] = $method;
		$method = $pyjs__bind_method2('addLayer', function(l) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				l = arguments[1];
			}

			self['layers']['append'](l);
			self['notifyLayerPanels']();
			return null;
		}
	, 1, [null,null,['self'],['l']]);
		$cls_definition['addLayer'] = $method;
		$method = $pyjs__bind_method2('removeLayer', function(l) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				l = arguments[1];
			}

			self['layers']['remove'](l);
			self['notifyLayerPanels']();
			return null;
		}
	, 1, [null,null,['self'],['l']]);
		$cls_definition['removeLayer'] = $method;
		$method = $pyjs__bind_method2('notifyLayerPanels', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var $iter3_idx,$iter3_type,l,$iter3_iter,$iter3_array,$iter3_nextval;
			$iter3_iter = $p['getattr'](self, 'layer_panels');
			$iter3_nextval=$p['__iter_prepare']($iter3_iter,false);
			while (typeof($p['__wrapped_next']($iter3_nextval)['$nextval']) != 'undefined') {
				l = $iter3_nextval['$nextval'];
				l['redraw']();
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['notifyLayerPanels'] = $method;
		$method = $pyjs__bind_method2('notifyLayerPanelsChecked', function(name, checked) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				name = arguments[1];
				checked = arguments[2];
			}
			var $iter4_nextval,l,$iter4_idx,$iter4_type,$iter4_array,$iter4_iter;
			$iter4_iter = $p['getattr'](self, 'layer_panels');
			$iter4_nextval=$p['__iter_prepare']($iter4_iter,false);
			while (typeof($p['__wrapped_next']($iter4_nextval)['$nextval']) != 'undefined') {
				l = $iter4_nextval['$nextval'];
				l['setChecked'](name, checked);
			}
			return null;
		}
	, 1, [null,null,['self'],['name'],['checked']]);
		$cls_definition['notifyLayerPanelsChecked'] = $method;
		$method = $pyjs__bind_method2('layerByName', function(name) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				name = arguments[1];
			}
			var $iter5_nextval,$iter5_array,l,$iter5_iter,$iter5_idx,$iter5_type;
			$iter5_iter = $p['getattr'](self, 'layers');
			$iter5_nextval=$p['__iter_prepare']($iter5_iter,false);
			while (typeof($p['__wrapped_next']($iter5_nextval)['$nextval']) != 'undefined') {
				l = $iter5_nextval['$nextval'];
				if ($p['bool']($p['op_eq']($p['getattr'](l, '$$name'), name))) {
					return l;
				}
			}
			return null;
		}
	, 1, [null,null,['self'],['name']]);
		$cls_definition['layerByName'] = $method;
		$method = $pyjs__bind_method2('onLoadNewLayerFactory', function(layer_name, onDone, info_panel, on_error) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				layer_name = arguments[1];
				onDone = arguments[2];
				info_panel = arguments[3];
				on_error = arguments[4];
			}
			var onLoadLayer;
			onLoadLayer = function(res) {
				var l;
				if ($p['bool'](res['__contains__']('errore'))) {
					if ($p['bool']((on_error !== null))) {
						on_error(res['__getitem__']('errore'));
					}
					return null;
				}
				l = (typeof Layer == "undefined"?$m['Layer']:Layer)(layer_name, res['__getitem__']('descrizione'), self);
				$pyjs_kwargs_call(l, 'deserialize', null, null, [{'info_panel':info_panel}, res]);
				l['centerOnMap']();
				if ($p['bool']((onDone !== null))) {
					self['onDone'](l);
				}
				return null;
			};
			onLoadLayer['__name__'] = 'onLoadLayer';

			onLoadLayer['__bind_type__'] = 0;
			onLoadLayer['__args__'] = [null,null,['res']];
			return onLoadLayer;
		}
	, 1, [null,null,['self'],['layer_name'],['onDone'],['info_panel'],['on_error']]);
		$cls_definition['onLoadNewLayerFactory'] = $method;
		$method = $pyjs__bind_method2('loadNewLayer', function(layer_name, func_name, func_id, onDone, toggle, reload, info_panel, on_error) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				layer_name = arguments[1];
				func_name = arguments[2];
				func_id = arguments[3];
				onDone = arguments[4];
				toggle = arguments[5];
				reload = arguments[6];
				info_panel = arguments[7];
				on_error = arguments[8];
			}
			if (typeof onDone == 'undefined') onDone=arguments['callee']['__args__'][6][1];
			if (typeof toggle == 'undefined') toggle=arguments['callee']['__args__'][7][1];
			if (typeof reload == 'undefined') reload=arguments['callee']['__args__'][8][1];
			if (typeof info_panel == 'undefined') info_panel=arguments['callee']['__args__'][9][1];
			if (typeof on_error == 'undefined') on_error=arguments['callee']['__args__'][10][1];
			var l;
			l = self['layerByName'](layer_name);
			if ($p['bool']((l !== null))) {
				if ($p['bool'](reload)) {
					l['destroy']();
				}
				else {
					if ($p['bool']((toggle === null))) {
						l['toggleVisible']();
					}
					else {
						l['setVisible'](toggle);
					}
					if ($p['bool']((onDone !== null))) {
						onDone(l);
					}
					return null;
				}
			}
			$m['client']['mappa_layer']($p['tuple']([func_name, func_id]), $m['JsonHandler'](self['onLoadNewLayerFactory'](layer_name, onDone, info_panel, on_error)));
			return null;
		}
	, 1, [null,null,['self'],['layer_name'],['func_name'],['func_id'],['onDone', null],['toggle', null],['reload', false],['info_panel', null],['on_error', null]]);
		$cls_definition['loadNewLayer'] = $method;
		$method = $pyjs__bind_method2('hideAllLayers', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var $iter6_idx,$iter6_type,l,$iter6_array,$iter6_iter,$iter6_nextval;
			$iter6_iter = $p['getattr'](self, 'layers');
			$iter6_nextval=$p['__iter_prepare']($iter6_iter,false);
			while (typeof($p['__wrapped_next']($iter6_nextval)['$nextval']) != 'undefined') {
				l = $iter6_nextval['$nextval'];
				l['setVisible'](false);
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['hideAllLayers'] = $method;
		var $bases = new Array($m['SimplePanel']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('MapPanel', $p['tuple']($bases), $data);
	})();
	$m['InfoPanel'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(owner, icon, name, desc, distance, onClic) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				owner = arguments[1];
				icon = arguments[2];
				name = arguments[3];
				desc = arguments[4];
				distance = arguments[5];
				onClic = arguments[6];
			}
			if (typeof onClic == 'undefined') onClic=arguments['callee']['__args__'][8][1];

			$m['HorizontalPanel']['__init__'](self);
			self['addStyleName']('palina');
			self['image'] = $m['Image'](icon);
			self['add']($p['getattr'](self, 'image'));
			self['hfp'] = $m['HTMLFlowPanel']();
			self['hfp']['addAnchor'](name, $p['getattr'](self, 'onClic'));
			if ($p['bool']((distance !== null))) {
				self['hfp']['addHtml']($p['sprintf']('&nbsp;a %s', distance));
			}
			self['hfp']['addBr']();
			self['hfp']['addHtml'](desc);
			self['add']($p['getattr'](self, 'hfp'));
			self['onClicCallback'] = onClic;
			return null;
		}
	, 1, [null,null,['self'],['owner'],['icon'],['name'],['desc'],['distance'],['onClic', null]]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('onClic', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			if ($p['bool'](((typeof onClicCallback == "undefined"?$m['onClicCallback']:onClicCallback) !== null))) {
				self['onClicCallback']();
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['onClic'] = $method;
		var $bases = new Array($m['HorizontalPanel']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('InfoPanel', $p['tuple']($bases), $data);
	})();
	$m['Layer'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(name, $$label, map_panel, owner) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				name = arguments[1];
				$$label = arguments[2];
				map_panel = arguments[3];
				owner = arguments[4];
			}
			if (typeof owner == 'undefined') owner=arguments['callee']['__args__'][6][1];
			var $$label;
			self['$$name'] = name;
			self['$$label'] = $$label;
			self['map_panel'] = map_panel;
			self['features'] = $p['list']([]);
			self['visible'] = true;
			self['sub'] = $p['list']([]);
			self['owner'] = owner;
			self['destroyed'] = false;
			if ($p['bool'](($p['getattr'](self, 'owner') === null))) {
				map_panel['addLayer'](self);
			}
			else {
				$m['client']['mappa_layer'](name, $m['JsonHandler']($p['getattr'](self, 'onMappaLayerDone')));
			}
			return null;
		}
	, 1, [null,null,['self'],['name'],['$$label'],['map_panel'],['owner', null]]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('onMappaLayerDone', function(res) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				res = arguments[1];
			}

			self['deserialize'](res);
			return null;
		}
	, 1, [null,null,['self'],['res']]);
		$cls_definition['onMappaLayerDone'] = $method;
		$method = $pyjs__bind_method2('getMap', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			return $p['getattr']($p['getattr'](self, 'map_panel'), 'map');
		}
	, 1, [null,null,['self']]);
		$cls_definition['getMap'] = $method;
		$method = $pyjs__bind_method2('deserialize', function(res, callbacks, info_panel) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				res = arguments[1];
				callbacks = arguments[2];
				info_panel = arguments[3];
			}
			if (typeof callbacks == 'undefined') callbacks=arguments['callee']['__args__'][4][1];
			if (typeof info_panel == 'undefined') info_panel=arguments['callee']['__args__'][5][1];
			var $iter10_nextval,m,$iter8_iter,marker,$iter10_iter,open,$iter9_iter,$iter9_nextval,$iter9_idx,infobox,$iter7_iter,$iter7_type,$iter8_type,$iter10_idx,ip,$iter8_idx,sl,$and1,$and2,$add5,dc,$iter8_nextval,$iter7_idx,$mul2,$mul1,name,$iter7_nextval,f,$iter7_array,$iter8_array,$iter10_array,$iter9_type,p,s,$add6,$iter10_type,$iter9_array;
			$iter7_iter = $p['getattr'](self, 'features');
			$iter7_nextval=$p['__iter_prepare']($iter7_iter,false);
			while (typeof($p['__wrapped_next']($iter7_nextval)['$nextval']) != 'undefined') {
				f = $iter7_nextval['$nextval'];
				f['setVisible'](false);
			}
			self['features'] = $p['list']([]);
			if ($p['bool'](res['__contains__']('markers'))) {
				$iter8_iter = res['__getitem__']('markers');
				$iter8_nextval=$p['__iter_prepare']($iter8_iter,false);
				while (typeof($p['__wrapped_next']($iter8_nextval)['$nextval']) != 'undefined') {
					m = $iter8_nextval['$nextval'];
					name = ($p['bool'](m['__contains__']('name'))? (m['__getitem__']('name')) : (null));
					open = ($p['bool'](m['__contains__']('open'))? (m['__getitem__']('open')) : (false));
					dc = null;
					if ($p['bool'](($p['bool']($and1=m['__contains__']('drop_callback'))?!$p['op_eq'](m['__getitem__']('drop_callback'), ''):$and1))) {
						dc = callbacks['__getitem__'](m['__getitem__']('drop_callback'));
					}
					infobox = $p['sprintf']('<b>%s</b>', m['__getitem__']('infobox'));
					if ($p['bool'](!$p['op_eq'](m['__getitem__']('desc'), ''))) {
						infobox = $p['__op_add']($add5=infobox,$add6=$p['sprintf']('<br /><br />%s', m['__getitem__']('desc')));
					}
					marker = $pyjs_kwargs_call(null, (typeof Marker == "undefined"?$m['Marker']:Marker), null, null, [{'visible':$p['getattr'](self, 'visible'), 'name':name, 'open':open, 'drop_callback':dc}, self, m['__getitem__']('point'), m['__getitem__']('icon'), m['__getitem__']('iconSize'), infobox, m['__getitem__']('label'), m['__getitem__']('anchor')]);
					if ($p['bool']((info_panel !== null))) {
						ip = $pyjs_kwargs_call(null, $m['InfoPanel'], null, null, [{'onClic':$p['getattr'](marker, 'openBubble')}, info_panel, m['__getitem__']('icon'), m['__getitem__']('infobox'), m['__getitem__']('desc'), m['__getitem__']('distance')]);
						info_panel['add'](ip);
					}
				}
			}
			if ($p['bool'](res['__contains__']('polylines'))) {
				$iter9_iter = res['__getitem__']('polylines');
				$iter9_nextval=$p['__iter_prepare']($iter9_iter,false);
				while (typeof($p['__wrapped_next']($iter9_nextval)['$nextval']) != 'undefined') {
					p = $iter9_nextval['$nextval'];
					$pyjs_kwargs_call(null, (typeof Polyline == "undefined"?$m['Polyline']:Polyline), null, null, [{'visible':$p['getattr'](self, 'visible')}, self, p['__getitem__']('points'), p['__getitem__']('opacity'), p['__getitem__']('color'), p['__getitem__']('thickness'), p['__getitem__']('zIndex')]);
				}
			}
			if ($p['bool'](res['__contains__']('sublayers'))) {
				$iter10_iter = res['__getitem__']('sublayers');
				$iter10_nextval=$p['__iter_prepare']($iter10_iter,false);
				while (typeof($p['__wrapped_next']($iter10_nextval)['$nextval']) != 'undefined') {
					s = $iter10_nextval['$nextval'];
					sl = $m['Layer'](s, null, $p['getattr'](self, 'map_panel'), self);
					self['sub']['append'](sl);
				}
			}
			if ($p['bool'](res['__contains__']('refresh'))) {
				$m['Timer']((typeof ($mul1=res['__getitem__']('refresh'))==typeof ($mul2=1000) && typeof $mul1=='number'?
					$mul1*$mul2:
					$p['op_mul']($mul1,$mul2)), $p['getattr'](self, 'onRefresh'));
			}
			return null;
		}
	, 1, [null,null,['self'],['res'],['callbacks', null],['info_panel', null]]);
		$cls_definition['deserialize'] = $method;
		$method = $pyjs__bind_method2('onRefresh', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			$m['client']['mappa_layer']($p['getattr'](self, '$$name'), $m['JsonHandler']($p['getattr'](self, 'onMappaLayerDone')));
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['onRefresh'] = $method;
		$method = $pyjs__bind_method2('setVisible', function(visible) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				visible = arguments[1];
			}
			if (typeof visible == 'undefined') visible=arguments['callee']['__args__'][3][1];
			var $iter12_type,f,$iter11_iter,$iter11_type,$iter12_array,$iter12_iter,s,$iter11_array,$iter11_nextval,$iter11_idx,$iter12_idx,$iter12_nextval;
			self['visible'] = visible;
			if ($p['bool'](($p['getattr'](self, 'owner') === null))) {
				self['map_panel']['notifyLayerPanelsChecked']($p['getattr'](self, '$$name'), visible);
			}
			$iter11_iter = $p['getattr'](self, 'features');
			$iter11_nextval=$p['__iter_prepare']($iter11_iter,false);
			while (typeof($p['__wrapped_next']($iter11_nextval)['$nextval']) != 'undefined') {
				f = $iter11_nextval['$nextval'];
				f['setVisible'](visible);
			}
			$iter12_iter = $p['getattr'](self, 'sub');
			$iter12_nextval=$p['__iter_prepare']($iter12_iter,false);
			while (typeof($p['__wrapped_next']($iter12_nextval)['$nextval']) != 'undefined') {
				s = $iter12_nextval['$nextval'];
				s['setVisible'](visible);
			}
			return null;
		}
	, 1, [null,null,['self'],['visible', true]]);
		$cls_definition['setVisible'] = $method;
		$method = $pyjs__bind_method2('toggleVisible', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			self['setVisible'](!$p['bool']($p['getattr'](self, 'visible')));
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['toggleVisible'] = $method;
		$method = $pyjs__bind_method2('destroy', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var $iter13_nextval,$iter13_iter,$iter13_type,s,$iter13_idx,$iter13_array;
			if ($p['bool'](!$p['bool']($p['getattr'](self, 'destroyed')))) {
				self['destroyed'] = true;
				$iter13_iter = $p['getattr'](self, 'sub');
				$iter13_nextval=$p['__iter_prepare']($iter13_iter,false);
				while (typeof($p['__wrapped_next']($iter13_nextval)['$nextval']) != 'undefined') {
					s = $iter13_nextval['$nextval'];
					s['destroy']();
				}
				self['sub'] = $p['list']([]);
				self['setVisible'](false);
				self['features'] = $p['list']([]);
				if ($p['bool'](($p['getattr'](self, 'owner') === null))) {
					self['map_panel']['removeLayer'](self);
				}
				else {
					self['owner'] = null;
				}
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['destroy'] = $method;
		$method = $pyjs__bind_method2('centerOnMap', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var map,$iter14_array,$iter14_type,f,m,bounds,n,$add7,$iter14_iter,$add8,$iter14_idx,$iter14_nextval;
			bounds = new $wnd['google'].maps.LatLngBounds();;
			map = $p['getattr']($p['getattr'](self, 'map_panel'), 'map');
			n = 0;
			$iter14_iter = $p['getattr'](self, 'features');
			$iter14_nextval=$p['__iter_prepare']($iter14_iter,false);
			while (typeof($p['__wrapped_next']($iter14_nextval)['$nextval']) != 'undefined') {
				f = $iter14_nextval['$nextval'];
				if ($p['bool']($p['isinstance'](f, (typeof Marker == "undefined"?$m['Marker']:Marker)))) {
					n = $p['__op_add']($add7=n,$add8=1);
					m = $p['getattr'](f, 'point');
bounds.extend(m);
				}
			}
			if ($p['bool'](($p['cmp'](n, 0) == 1))) {
map.fitBounds(bounds);
				if ($p['bool']($p['op_eq'](n, 1))) {
map.setZoom(16);
				}
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['centerOnMap'] = $method;
		var $bases = new Array(pyjslib['object']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('Layer', $p['tuple']($bases), $data);
	})();
	$m['LayerPanel'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(map) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				map = arguments[1];
			}

			$m['VerticalPanel']['__init__'](self);
			self['map'] = map;
			self['cbs'] = $p['list']([]);
			self['names'] = $p['dict']([]);
			self['map']['addLayerPanel'](self);
			self['no_layers'] = $m['HTML']('Cerca un percorso, una linea o una fermata per mostrarla sulla mappa.');
			self['add']($p['getattr'](self, 'no_layers'));
			self['setWidth']('100%');
			return null;
		}
	, 1, [null,null,['self'],['map']]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('redraw', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var $iter16_array,c,$iter15_iter,$iter16_type,i,cb,$iter15_array,l,$iter15_idx,$iter16_idx,$iter15_nextval,$iter15_type,$iter16_nextval,$iter16_iter,hp;
			if ($p['bool'](($p['getattr'](self, 'no_layers') !== null))) {
				self['remove']($p['getattr'](self, 'no_layers'));
				self['no_layers'] = null;
			}
			$iter15_iter = $p['getattr'](self, 'cbs');
			$iter15_nextval=$p['__iter_prepare']($iter15_iter,false);
			while (typeof($p['__wrapped_next']($iter15_nextval)['$nextval']) != 'undefined') {
				c = $iter15_nextval['$nextval'];
				self['remove'](c);
			}
			self['cbs'] = $p['list']([]);
			self['names'] = $p['dict']([]);
			$iter16_iter = $p['getattr']($p['getattr'](self, 'map'), 'layers');
			$iter16_nextval=$p['__iter_prepare']($iter16_iter,false);
			while (typeof($p['__wrapped_next']($iter16_nextval)['$nextval']) != 'undefined') {
				l = $iter16_nextval['$nextval'];
				hp = $m['HorizontalPanel']();
				cb = $m['CheckBox']($p['getattr'](l, '$$label'));
				cb['setChecked']($p['getattr'](l, 'visible'));
				cb['addClickListener']($p['getattr'](self, 'onCB'));
				cb['layer'] = l;
				hp['add'](cb);
				i = $m['Image']('close.png');
				i['addClickListener'](self['onCloseLayerFactory'](l));
				hp['add'](i);
				hp['setCellHorizontalAlignment'](i, $p['getattr']($m['HasAlignment'], 'ALIGN_RIGHT'));
				hp['setCellVerticalAlignment'](i, $p['getattr']($m['HasAlignment'], 'ALIGN_MIDDLE'));
				hp['setWidth']('100%');
				self['add'](hp);
				self['setCellWidth'](hp, '100%');
				$p['getattr'](self, 'names')['__setitem__']($p['getattr'](l, '$$name'), cb);
				self['cbs']['append'](hp);
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['redraw'] = $method;
		$method = $pyjs__bind_method2('onCloseLayerFactory', function(layer) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				layer = arguments[1];
			}
			var onCloseLayer;
			onCloseLayer = function() {

				layer['destroy']();
				return null;
			};
			onCloseLayer['__name__'] = 'onCloseLayer';

			onCloseLayer['__bind_type__'] = 0;
			onCloseLayer['__args__'] = [null,null];
			return onCloseLayer;
		}
	, 1, [null,null,['self'],['layer']]);
		$cls_definition['onCloseLayerFactory'] = $method;
		$method = $pyjs__bind_method2('onCB', function(source) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				source = arguments[1];
			}

			source['layer']['setVisible'](source['isChecked']());
			return null;
		}
	, 1, [null,null,['self'],['source']]);
		$cls_definition['onCB'] = $method;
		$method = $pyjs__bind_method2('setChecked', function(name, checked) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				name = arguments[1];
				checked = arguments[2];
			}
			var cb;
			if ($p['bool']($p['getattr'](self, 'names')['__contains__'](name))) {
				cb = $p['getattr'](self, 'names')['__getitem__'](name);
				cb['setChecked'](checked);
			}
			return null;
		}
	, 1, [null,null,['self'],['name'],['checked']]);
		$cls_definition['setChecked'] = $method;
		var $bases = new Array($m['VerticalPanel']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('LayerPanel', $p['tuple']($bases), $data);
	})();
	$m['Marker'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(layer, point, icon_path, icon_size, infobox, $$label, anchor, infobox_listener, visible, name, open, drop_callback) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				layer = arguments[1];
				point = arguments[2];
				icon_path = arguments[3];
				icon_size = arguments[4];
				infobox = arguments[5];
				$$label = arguments[6];
				anchor = arguments[7];
				infobox_listener = arguments[8];
				visible = arguments[9];
				name = arguments[10];
				open = arguments[11];
				drop_callback = arguments[12];
			}
			if (typeof icon_size == 'undefined') icon_size=arguments['callee']['__args__'][6][1];
			if (typeof infobox == 'undefined') infobox=arguments['callee']['__args__'][7][1];
			if (typeof $$label == 'undefined') $$label=arguments['callee']['__args__'][8][1];
			if (typeof anchor == 'undefined') anchor=arguments['callee']['__args__'][9][1];
			if (typeof infobox_listener == 'undefined') infobox_listener=arguments['callee']['__args__'][10][1];
			if (typeof visible == 'undefined') visible=arguments['callee']['__args__'][11][1];
			if (typeof name == 'undefined') name=arguments['callee']['__args__'][12][1];
			if (typeof open == 'undefined') open=arguments['callee']['__args__'][13][1];
			if (typeof drop_callback == 'undefined') drop_callback=arguments['callee']['__args__'][14][1];
			var marker,ax,lb,ajs,$$label,map,$or1,$or2,ay,draggable,y,x;
			self['layer'] = layer;
			self['visible'] = visible;
			self['$$name'] = name;
			layer['features']['append'](self);
			map = ($p['bool'](visible)? (layer['getMap']()) : (null));
			lb = $$label;
			x = point['__getitem__'](1);
			y = point['__getitem__'](0);
			self['bubble'] = null;
			if ($p['bool']((anchor !== null))) {
				ax = anchor['__getitem__'](0);
				ay = anchor['__getitem__'](1);
ajs = new $wnd['google'].maps.Point(ax, ay);
			}
			else {
				ajs = null;
			}
			draggable = ($p['bool']((drop_callback === null))? (false) : (true));
			self['marker'] = 
			self.point = new $wnd['google'].maps.LatLng(x, y);
			mImg = new $wnd['google'].maps.MarkerImage(icon_path, null, null, ajs);
			mOpt = {
				position: self.point,
				title: lb,
				icon: mImg,
				draggable: draggable,
				map: map
			};
			self.marker = new $wnd['google'].maps.Marker(mOpt);
		;
			marker = $p['getattr'](self, 'marker');
			if ($p['bool']((drop_callback !== null))) {

				$wnd['google'].maps.event.addListener(marker, 'dragend', function() {
					var latlng = marker.getPosition();
					drop_callback(latlng.lat(), latlng.lng());
				});
			
			}
			if ($p['bool'](($p['bool']($or1=(infobox !== null))?$or1:(infobox_listener !== null)))) {
				if ($p['bool']((infobox !== null))) {
					infobox_listener = $p['getattr'](self, 'openBubble');
				}
				else {
					infobox = '';
				}

				mInfoOpt = {
					content: infobox,
					position: new $wnd['google'].maps.LatLng(x, y),
					pixelOffset: new $wnd['google'].maps.Size(0, 0),
					visible: true
				};
			
				self['bubble'] = new $wnd['google'].maps.InfoWindow(mInfoOpt);;
$wnd['google'].maps.event.addListener(self.marker, "click", function() {infobox_listener(); });
			}
			if ($p['bool'](open)) {
				self['openBubble']();
			}
			return null;
		}
	, 1, [null,null,['self'],['layer'],['point'],['icon_path'],['icon_size', $p['tuple']([20, 20])],['infobox', null],['$$label', null],['anchor', null],['infobox_listener', null],['visible', true],['name', null],['open', false],['drop_callback', null]]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('openBubble', function(new_content) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				new_content = arguments[1];
			}
			if (typeof new_content == 'undefined') new_content=arguments['callee']['__args__'][3][1];
			var map;
			self['layer']['map_panel']['replace_bubble'](self);
			map = self['layer']['getMap']();
			if ($p['bool']((new_content !== null))) {
				self['bubble']['setContent'](new_content);
			}
			else if ($p['bool'](($p['getattr'](self, '$$name') !== null))) {
				$m['client']['mappa_layer']($p['getattr'](self, '$$name'), $m['JsonHandler']($p['getattr'](self, 'onMappaLayerDone')));
			}
self.bubble.open(map, self.marker);
		}
	, 1, [null,null,['self'],['new_content', null]]);
		$cls_definition['openBubble'] = $method;
		$method = $pyjs__bind_method2('onMappaLayerDone', function(res) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				res = arguments[1];
			}

			self['bubble']['setContent'](res);
			return null;
		}
	, 1, [null,null,['self'],['res']]);
		$cls_definition['onMappaLayerDone'] = $method;
		$method = $pyjs__bind_method2('closeBubble', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

self.bubble.close();
		}
	, 1, [null,null,['self']]);
		$cls_definition['closeBubble'] = $method;
		$method = $pyjs__bind_method2('setVisible', function(visible) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				visible = arguments[1];
			}
			var map;
			self['visible'] = visible;
			if ($p['bool'](visible)) {
				map = self['layer']['getMap']();
			}
			else {
				map = null;
			}
			self['marker']['setMap'](map);
			return null;
		}
	, 1, [null,null,['self'],['visible']]);
		$cls_definition['setVisible'] = $method;
		var $bases = new Array(pyjslib['object']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('Marker', $p['tuple']($bases), $data);
	})();
	$m['Polyline'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(layer, points, opacity, color, thickness, zIndex, visible) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				layer = arguments[1];
				points = arguments[2];
				opacity = arguments[3];
				color = arguments[4];
				thickness = arguments[5];
				zIndex = arguments[6];
				visible = arguments[7];
			}
			if (typeof opacity == 'undefined') opacity=arguments['callee']['__args__'][5][1];
			if (typeof color == 'undefined') color=arguments['callee']['__args__'][6][1];
			if (typeof thickness == 'undefined') thickness=arguments['callee']['__args__'][7][1];
			if (typeof zIndex == 'undefined') zIndex=arguments['callee']['__args__'][8][1];
			if (typeof visible == 'undefined') visible=arguments['callee']['__args__'][9][1];
			var map,pt;
			pt = $m['list_to_point_array'](points);
			self['visible'] = visible;
			self['layer'] = layer;
			layer['features']['append'](self);
			map = ($p['bool'](visible)? (layer['getMap']()) : (null));

			var myPolyOpt = {
					strokeColor: color,
					strokeOpacity: opacity,
					strokeWeight: thickness,
					visible: true,
					zIndex: zIndex
			}
			self.myPoly = new $wnd['google'].maps.Polyline(myPolyOpt);
			self.myPoly.setPath(pt);
			self.myPoly.setMap(map);
		
		}
	, 1, [null,null,['self'],['layer'],['points'],['opacity', 1],['color', '#000000'],['thickness', 1],['zIndex', 0],['visible', true]]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('setVisible', function(visible) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				visible = arguments[1];
			}
			var map;
			self['visible'] = visible;
			if ($p['bool'](visible)) {
				map = self['layer']['getMap']();
			}
			else {
				map = null;
			}
			self['myPoly']['setMap'](map);
			return null;
		}
	, 1, [null,null,['self'],['visible']]);
		$cls_definition['setVisible'] = $method;
		var $bases = new Array(pyjslib['object']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('Polyline', $p['tuple']($bases), $data);
	})();
	$m['Geocoder'] = (function(){
		var $cls_definition = new Object();
		var $method;
		$cls_definition['__module__'] = 'map';
		$method = $pyjs__bind_method2('__init__', function(search, method, map, pin_url, pin_size, lngBox, latBox, callback) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				search = arguments[1];
				method = arguments[2];
				map = arguments[3];
				pin_url = arguments[4];
				pin_size = arguments[5];
				lngBox = arguments[6];
				latBox = arguments[7];
				callback = arguments[8];
			}
			if (typeof map == 'undefined') map=arguments['callee']['__args__'][5][1];
			if (typeof pin_url == 'undefined') pin_url=arguments['callee']['__args__'][6][1];
			if (typeof pin_size == 'undefined') pin_size=arguments['callee']['__args__'][7][1];
			if (typeof lngBox == 'undefined') lngBox=arguments['callee']['__args__'][8][1];
			if (typeof latBox == 'undefined') latBox=arguments['callee']['__args__'][9][1];
			if (typeof callback == 'undefined') callback=arguments['callee']['__args__'][10][1];

			self['search'] = search;
			self['map'] = map;
			self['search']['addKeyboardListener'](self);
			self['search']['addChangeListener']($p['getattr'](self, 'onSearchChange'));
			self['method'] = method;
			self['lngBox'] = lngBox;
			self['latBox'] = latBox;
			if ($p['bool'](($p['getattr'](self, 'lngBox') !== null))) {
				self['lngBox']['addKeyboardListener'](self);
				self['lngBox']['addChangeListener']($p['getattr'](self, 'onLngLatChange'));
				self['latBox']['addKeyboardListener'](self);
				self['latBox']['addChangeListener']($p['getattr'](self, 'onLngLatChange'));
			}
			self['lat'] = null;
			self['lng'] = null;
			self['valid'] = false;
			self['layer'] = null;
			self['marker'] = null;
			self['pin_url'] = pin_url;
			self['pin_size'] = pin_size;
			self['popup'] = null;
			self['callback'] = callback;
			return null;
		}
	, 1, [null,null,['self'],['search'],['method'],['map', null],['pin_url', 'partenza_percorso.png'],['pin_size', $p['tuple']([32, 32])],['lngBox', null],['latBox', null],['callback', null]]);
		$cls_definition['__init__'] = $method;
		$method = $pyjs__bind_method2('onSearchChange', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			if ($p['bool'](!$p['bool']($p['getattr'](self, 'valid')))) {
				self['disambiguate']();
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['onSearchChange'] = $method;
		$method = $pyjs__bind_method2('onLngLatChange', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			self['parseLngLatFromBoxes']();
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['onLngLatChange'] = $method;
		$method = $pyjs__bind_method2('onKeyUp', function(sender, keycode, modifiers) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				sender = arguments[1];
				keycode = arguments[2];
				modifiers = arguments[3];
			}
			var $and3,$and4;
			self['search']['removeStyleName']('validation-error');
			if ($p['bool']($p['op_eq'](sender, $p['getattr'](self, 'search')))) {
				self['valid'] = false;
				if ($p['bool'](($p['bool']($and3=$p['op_eq'](keycode, 40))?($p['getattr'](self, 'popup') !== null):$and3))) {
					self['popup']['setFocus']();
				}
				else if ($p['bool'](($p['getattr'](self, 'popup') !== null))) {
					self['popup']['hide']();
				}
				if ($p['bool']($p['op_eq'](keycode, 13))) {
					self['disambiguate']();
				}
			}
			else {
				self['parseLngLatFromBoxes']();
			}
			return null;
		}
	, 1, [null,null,['self'],['sender'],['keycode'],['modifiers']]);
		$cls_definition['onKeyUp'] = $method;
		$method = $pyjs__bind_method2('parseLngLatFromBoxes', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var lat,$pyjs_try_err;
			try {
				lat = $p['float'](self['latBox']['getText']());
				self['lng'] = $p['float'](self['lngBox']['getText']());
				self['lat'] = lat;
				self['valid'] = true;
				self['updateMap']();
			} catch($pyjs_try_err) {
				var $pyjs_try_err_name = (typeof $pyjs_try_err['__name__'] == 'undefined' ? $pyjs_try_err['name'] : $pyjs_try_err['__name__'] );
				$pyjs['__last_exception__'] = {'error': $pyjs_try_err, 'module': $m};
				if (($pyjs_try_err_name == $p['Exception']['__name__'])||$p['_isinstance']($pyjs_try_err,$p['Exception'])) {
					self['valid'] = false;
				} else { $pyjs['__active_exception_stack__'] = $pyjs['__last_exception_stack__']; $pyjs['__last_exception_stack__'] = null; throw $pyjs_try_err; }
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['parseLngLatFromBoxes'] = $method;
		$method = $pyjs__bind_method2('onSearchPopupSelected', function(pk, address) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				pk = arguments[1];
				address = arguments[2];
			}

			self['search']['setText'](address);
			self['popup']['hide']();
			self['disambiguate']();
			return null;
		}
	, 1, [null,null,['self'],['pk'],['address']]);
		$cls_definition['onSearchPopupSelected'] = $method;
		$method = $pyjs__bind_method2('onDisambiguateDone', function(res) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				res = arguments[1];
			}
			var $add9,$add10;
			if ($p['bool']($p['op_eq'](res['__getitem__']('stato'), 'OK'))) {
				self['valid'] = true;
				self['lat'] = res['__getitem__']('lat');
				self['lng'] = res['__getitem__']('lng');
				self['search']['setText'](res['__getitem__']('indirizzo'));
				self['updateCoordBoxes']();
				self['updateMap']();
			}
			else if ($p['bool']($p['op_eq'](res['__getitem__']('stato'), 'Ambiguous'))) {
				self['valid'] = false;
				res = function(){
					var $iter17_nextval,x,$iter17_iter,$collcomp1,$iter17_array,$iter17_idx,$iter17_type;
	$collcomp1 = $p['list']();
				$iter17_iter = res['__getitem__']('indirizzi');
				$iter17_nextval=$p['__iter_prepare']($iter17_iter,false);
				while (typeof($p['__wrapped_next']($iter17_nextval)['$nextval']) != 'undefined') {
					x = $iter17_nextval['$nextval'];
					$collcomp1['append']($p['tuple']([x, x]));
				}

	return $collcomp1;}();
				if ($p['bool'](($p['getattr'](self, 'popup') !== null))) {
					self['popup']['update'](res);
				}
				else {
					self['popup'] = $m['SearchPopup'](res, $p['getattr'](self, 'onSearchPopupSelected'));
				}
				self['popup']['setPopupPosition'](self['search']['getAbsoluteLeft'](), $p['__op_add']($add9=self['search']['getAbsoluteTop'](),$add10=20));
				self['popup']['show']();
			}
			else {
				self['valid'] = false;
			}
			return null;
		}
	, 1, [null,null,['self'],['res']]);
		$cls_definition['onDisambiguateDone'] = $method;
		$method = $pyjs__bind_method2('disambiguate', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var place;
			place = self['search']['getText']();
			if ($p['bool'](((($p['cmp']($p['len'](place), 3))|1) == 1))) {
				self['method'](place, $m['JsonHandler']($p['getattr'](self, 'onDisambiguateDone')));
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['disambiguate'] = $method;
		$method = $pyjs__bind_method2('coordToString', function(coord) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				coord = arguments[1];
			}

			if ($p['bool']((coord === null))) {
				return '';
			}
			return $p['sprintf']('%f', coord);
		}
	, 1, [null,null,['self'],['coord']]);
		$cls_definition['coordToString'] = $method;
		$method = $pyjs__bind_method2('updateCoordBoxes', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			if ($p['bool'](($p['getattr'](self, 'lngBox') !== null))) {
				self['lngBox']['setText'](self['coordToString']($p['getattr'](self, 'lng')));
				self['latBox']['setText'](self['coordToString']($p['getattr'](self, 'lat')));
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['updateCoordBoxes'] = $method;
		$method = $pyjs__bind_method2('updateMap', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}
			var m;
			if ($p['bool'](($p['getattr'](self, 'map') !== null))) {
				if ($p['bool'](($p['getattr'](self, 'layer') !== null))) {
					self['layer']['destroy']();
				}
				self['layer'] = $m['Layer']('geocoder_layer', 'Indirizzo trovato', $p['getattr'](self, 'map'));
				m = $pyjs_kwargs_call(null, $m['Marker'], null, null, [{'icon_size':$p['getattr'](self, 'pin_size'), 'drop_callback':$p['getattr'](self, 'onDrop')}, $p['getattr'](self, 'layer'), $p['tuple']([$p['getattr'](self, 'lng'), $p['getattr'](self, 'lat')]), $p['getattr'](self, 'pin_url')]);
				self['layer']['centerOnMap']();
			}
			if ($p['bool'](($p['getattr'](self, 'callback') !== null))) {
				self['callback']();
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['updateMap'] = $method;
		$method = $pyjs__bind_method2('onDrop', function(lat, lng) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				lat = arguments[1];
				lng = arguments[2];
			}

			self['lng'] = lng;
			self['lat'] = lat;
			self['updateCoordBoxes']();
			if ($p['bool'](($p['getattr'](self, 'callback') !== null))) {
				self['callback']();
			}
			return null;
		}
	, 1, [null,null,['self'],['lat'],['lng']]);
		$cls_definition['onDrop'] = $method;
		$method = $pyjs__bind_method2('setAddress', function(address, lng, lat) {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
				address = arguments[1];
				lng = arguments[2];
				lat = arguments[3];
			}

			self['search']['setText'](address);
			self['lng'] = lng;
			self['lat'] = lat;
			self['valid'] = true;
			self['updateCoordBoxes']();
			self['updateMap']();
			return null;
		}
	, 1, [null,null,['self'],['address'],['lng'],['lat']]);
		$cls_definition['setAddress'] = $method;
		$method = $pyjs__bind_method2('getAddress', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			if ($p['bool']($p['getattr'](self, 'valid'))) {
				return $p['tuple']([self['search']['getText'](), $p['getattr'](self, 'lng'), $p['getattr'](self, 'lat')]);
			}
			else {
				return null;
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['getAddress'] = $method;
		$method = $pyjs__bind_method2('setValidationError', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			self['search']['addStyleName']('validation-error');
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['setValidationError'] = $method;
		$method = $pyjs__bind_method2('destroy', function() {
			if (this['__is_instance__'] === true) {
				var self = this;
			} else {
				var self = arguments[0];
			}

			if ($p['bool'](($p['getattr'](self, 'layer') !== null))) {
				self['layer']['destroy']();
			}
			return null;
		}
	, 1, [null,null,['self']]);
		$cls_definition['destroy'] = $method;
		var $bases = new Array($m['KeyboardHandler']);
		var $data = $p['dict']();
		for (var $item in $cls_definition) { $data['__setitem__']($item, $cls_definition[$item]); }
		return $p['_create_class']('Geocoder', $p['tuple']($bases), $data);
	})();
	return this;
}; /* end map */


/* end module: map */


/*
PYJS_DEPS: ['pyjamas.ui.Calendar.Calendar', 'pyjamas', 'pyjamas.ui', 'pyjamas.ui.Calendar', 'pyjamas.ui.Calendar.DateField', 'pyjamas.ui.RootPanel.RootPanel', 'pyjamas.ui.RootPanel', 'pyjamas.ui.VerticalPanel.VerticalPanel', 'pyjamas.ui.VerticalPanel', 'pyjamas.ui.HorizontalPanel.HorizontalPanel', 'pyjamas.ui.HorizontalPanel', 'pyjamas.ui.SimplePanel.SimplePanel', 'pyjamas.ui.SimplePanel', 'pyjamas.ui.FlowPanel.FlowPanel', 'pyjamas.ui.FlowPanel', 'pyjamas.ui.DisclosurePanel.DisclosurePanel', 'pyjamas.ui.DisclosurePanel', 'pyjamas.ui.TabPanel.TabPanel', 'pyjamas.ui.TabPanel', 'pyjamas.ui.Grid.Grid', 'pyjamas.ui.Grid', 'pyjamas.ui.Frame.Frame', 'pyjamas.ui.Frame', 'pyjamas.ui.TextBox.TextBox', 'pyjamas.ui.TextBox', 'pyjamas.ui.TextArea.TextArea', 'pyjamas.ui.TextArea', 'pyjamas.ui.HTML.HTML', 'pyjamas.ui.HTML', 'pyjamas.ui.Label.Label', 'pyjamas.ui.Label', 'pyjamas.ui.CheckBox.CheckBox', 'pyjamas.ui.CheckBox', 'pyjamas.ui.ListBox.ListBox', 'pyjamas.ui.ListBox', 'pyjamas.ui.Button.Button', 'pyjamas.ui.Button', 'pyjamas.ui.PopupPanel.PopupPanel', 'pyjamas.ui.PopupPanel', 'pyjamas.ui.KeyboardListener.KeyboardHandler', 'pyjamas.ui.KeyboardListener', 'pyjamas.ui.Tree.Tree', 'pyjamas.ui.Tree', 'pyjamas.ui.Tree.TreeItem', 'pyjamas.ui.Image.Image', 'pyjamas.ui.Image', 'pyjamas.ui.HasAlignment', 'pyjamas.ui.MenuBar.MenuBar', 'pyjamas.ui.MenuBar', 'pyjamas.ui.MenuItem.MenuItem', 'pyjamas.ui.MenuItem', 'pyjamas.ui.Widget.Widget', 'pyjamas.ui.Widget', 'pyjamas.ui.Hyperlink.Hyperlink', 'pyjamas.ui.Hyperlink', 'pyjamas.Window', 'pyjamas.Timer.Timer', 'pyjamas.Timer', 'pyjamas.JSONService.JSONProxy', 'pyjamas.JSONService', 'pyjamas.History', 'pyjamas.DOM', 'prnt.prnt', 'prnt', 'pyjamas.gmaps.Map.Map', 'pyjamas.gmaps', 'pyjamas.gmaps.Map', 'pyjamas.gmaps.Map.MapTypeId', 'pyjamas.gmaps.Map.MapOptions', 'pyjamas.gmaps.Base.LatLng', 'pyjamas.gmaps.Base', 'pyjamas.ui.ContextMenuPopupPanel.ContextMenuPopupPanel', 'pyjamas.ui.ContextMenuPopupPanel', 'datetime.date', 'datetime', 'datetime.time', 'datetime.datetime', 'datetime.timedelta', 'DissolvingPopup.DissolvingPopup', 'DissolvingPopup', 'util.JsonHandler', 'util', 'util.redirect', 'util.MenuCmd', 'util.HTMLFlowPanel', 'util.SearchPopup']
*/
