1 line
61 KiB
JavaScript
1 line
61 KiB
JavaScript
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-geo_fence-GEOFenceViewController","leaflet-timetrex"],{7191:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GEOFenceViewController\": () => (/* binding */ GEOFenceViewController)\n/* harmony export */ });\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5243);\n/* harmony import */ var leaflet__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(leaflet__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var leaflet_draw__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1787);\n/* harmony import */ var leaflet_draw__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(leaflet_draw__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _global_widgets_color_picker_TColorPicker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3161);\n/* harmony import */ var _framework_leaflet_leaflet_timetrex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6889);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n// CSS\n\n\n\n// JS\n\n\n\n\n// Note: If markers are ever used in GeoFence Editor/Viewer, then see image fix in leaflet-timetrex. https://github.com/Leaflet/Leaflet/issues/4968\n\nclass GEOFenceViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#geo_fence_view_container',\n\n\t\t\t// _required_files: {\n\t\t\t// \t15: ['leaflet-timetrex', 'TColorPicker']\n\t\t\t// },\n\t\t\ttype_array: null,\n\n\t\t\tcompany_api: null,\n\t\t\tdrawControl: null,\n\t\t\tbounds: null,\n\t\t\tdrawnItems: null,\n\t\t\tsearch_key_delay: 0,\n\t\t\tstart_coordinates: null,\n\t\t\tmap_html_id: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit() {\n\t\t//this._super('initialize' );\n\t\tthis.edit_view_tpl = 'GEOFenceEditView.html';\n\t\tthis.permission_id = 'geo_fence';\n\t\tthis.viewId = 'GEOFence';\n\t\tthis.script_name = 'GEOFenceView';\n\t\tthis.table_name_key = 'geo_fence';\n\t\tthis.context_menu_name = $.i18n._( 'GEO Fence' );\n\t\tthis.navigation_label = $.i18n._( 'GEO Fence' );\n\t\tthis.api = TTAPI.APIGEOFence;\n\t\tthis.company_api = TTAPI.APICompany;\n\n\t\tif ( this.map ) {\n\t\t\tdelete ( this.map );\n\t\t}\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\tmap: {\n\t\t\t\t\tlabel: $.i18n._( 'Map' ),\n\t\t\t\t\tid: this.viewId + 'Navigation'\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: ['export_excel', 'mass_edit'],\n\t\t\tinclude: [{\n\t\t\t\tlabel: $.i18n._( 'Map' ),\n\t\t\t\tid: 'map',\n\t\t\t\tmenu_align: 'right',\n\t\t\t\tgroup: 'map',\n\t\t\t\tvue_icon: 'tticon tticon-map_black_24dp',\n\t\t\t\tsort_order: 8000,\n\t\t\t}]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'map':\n\t\t\t\tthis.onMapClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonSaveAndContinueClick() {\n\t\tsuper.onSaveAndContinueClick();\n\t}\n\n\tonMapClick() {\n\t\t// only trigger map load in specific product editions.\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tvar geo_fences;\n\t\t\tif ( this.edit_view ) {\n\t\t\t\tgeo_fences = [this.current_edit_record];\n\t\t\t} else if ( this.getGridSelectIdArray().length > 0 ) {\n\t\t\t\tgeo_fences = this.getSelectedItems();\n\t\t\t} else {\n\t\t\t\tgeo_fences = this.grid.getGridParam( 'data' );\n\t\t\t}\n\t\t\t// Currently not doing pre-processing for geofences, handling this directly in MapViewController\n\t\t\t// var processed_data_for_map = TTMapLib.TTConvertMapData.processBasicFromGenericViewController(geo_fences);\n\t\t\tIndexViewController.openEditView( this, 'Map', geo_fences );\n\t\t}\n\t}\n\n\tonAddClick() {\n\t\tTTPromise.add( 'init', 'init' );\n\t\tsuper.onAddClick();\n\n\t\tvar $this = this;\n\t\tTTPromise.wait( 'init', 'init', function() {\n\n\t\t\t// Clear the old record to prevent duplication on inserting an empty geofence record. See #2131\n\t\t\t$this._selectedShape = false;\n\t\t\t$this.current_edit_record = {};\n\t\t\tfor ( var key in $this.edit_view_ui_dic ) {\n\t\t\t\t$this.edit_view_ui_dic[key].setValue( '' );\n\t\t\t}\n\n\t\t\tif ( !$this.map_control ) {\n\t\t\t\t$this._initLeafletMap();\n\t\t\t}\n\n\t\t\t$this.map_control.setView( $this.start_coordinates, 10 );\n\t\t} );\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = {};\n\t\tcolumn_filter.is_owner = true;\n\t\tcolumn_filter.id = true;\n\t\tcolumn_filter.is_child = true;\n\t\tcolumn_filter.in_use = true;\n\t\tcolumn_filter.first_name = true;\n\t\tcolumn_filter.last_name = true;\n\t\tcolumn_filter.geo_circle = true;\n\t\tcolumn_filter.geo_color = true;\n\t\tcolumn_filter.geo_polygon = true;\n\t\tcolumn_filter.geo_type_id = true;\n\n\t\t// Error: Unable to get property 'getGridParam' of undefined or null reference\n\t\tvar display_columns = [];\n\t\tif ( this.grid ) {\n\t\t\tdisplay_columns = this.grid.getGridParam( 'colModel' );\n\t\t}\n\t\t//Fixed possible exception -- Error: Unable to get property 'length' of undefined or null reference in /interface/html5/views/BaseViewController.js?v=7.4.3-20140924-090129 line 5031\n\t\tif ( display_columns ) {\n\t\t\tvar len = display_columns.length;\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tvar column_info = display_columns[i];\n\t\t\t\tcolumn_filter[column_info.name] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn column_filter;\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_geo_fence': {\n\t\t\t\t'label': $.i18n._( 'GEO Fence' ),\n\t\t\t\t'html_template': this.getGeoFenceTabHtml()\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tvar form_item_input;\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIGEOFence,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_geo_fence',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_geo_fence = this.edit_view_tab.find( '#tab_geo_fence' );\n\n\t\tvar tab_geo_fence_column1 = tab_geo_fence.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_geo_fence_column1 );\n\n\t\t// Name\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'name', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_geo_fence_column1 );\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t//Color\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COLOR_PICKER );\n\t\tform_item_input.TColorPicker( { field: 'geo_color' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Color' ), form_item_input, tab_geo_fence_column1 );\n\n\t\t// Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_geo_fence_column1 );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\tthis._initLeafletMap();\n\t}\n\n\t_initLeafletMap() {\n\t\tthis.neeed_save_punches_dic = {};\n\t\tthis.layers = [];\n\t\tthis.line_layers = [];\n\t\tthis.circle_layers = [];\n\t\tthis.directions_displays = [];\n\t\tthis.info_panel_dic = {};\n\t\tthis.geo_layers = [];\n\t\t//init map\n\n\t\tif ( !this.map_control || this.map_control == undefined || $( '#tab_geo_fence:visible #map_container div.google-map' )[0] == undefined ) {\n\n\t\t\tvar layers;\n\t\t\tvar map_layers;\n\t\t\tif ( APIGlobal.pre_login_data.map_provider && APIGlobal.pre_login_data.map_provider == 'mapbox' ) {\n\t\t\t\tvar osmUrl = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}';\n\t\t\t\tvar osmAttrib = '© <a href=\"https://www.mapbox.com/about/maps/\">Mapbox</a> © <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> <strong><a href=\"https://www.mapbox.com/map-feedback/\" target=\"_blank\">Improve this map</a></strong>';\n\n\t\t\t\tlayers = [ leaflet__WEBPACK_IMPORTED_MODULE_0___default().tileLayer( osmUrl, { attribution: osmAttrib, tileSize: 512, maxZoom: 18, zoomOffset: -1, id: 'mapbox/streets-v11', accessToken: APIGlobal.pre_login_data.map_api_key }), ]; //Street Maps\n\t\t\t\tmap_layers = { 'Streets': layers[0], 'Satellite': leaflet__WEBPACK_IMPORTED_MODULE_0___default().tileLayer( osmUrl, { attribution: osmAttrib, tileSize: 512, maxZoom: 18, zoomOffset: -1, id: 'mapbox/satellite-streets-v11', accessToken: APIGlobal.pre_login_data.map_api_key }) }; //Street+Satellite\n\t\t\t} else {\n\t\t\t\tvar osmUrl = APIGlobal.pre_login_data.map_tile_url + '/{z}/{x}/{y}.png?tt_key=' + APIGlobal.pre_login_data.registration_key;\n\t\t\t\tvar osmAttrib = 'Map data by ©<a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>.';\n\n\t\t\t\tlayers = [ new (leaflet__WEBPACK_IMPORTED_MODULE_0___default().TileLayer)( osmUrl, { minZoom: 3, maxZoom: 18, attribution: osmAttrib, noWrap: true } ) ];\n\t\t\t}\n\n\t\t\t//Avoid map is already initialized js exception by dynamically attaching the map element.\n\t\t\t// if (this.map_html_id && $('#' + this.map_html_id).length > 0) {\n\t\t\t// \t$( '#tab_geo_fence:visible #map_container #' + this.map_html_id ).off();\n\t\t\t// \tDebug.Text('Removed Lmap id: ' + this.map_html_id, 'GEOFenceViewController.js', 'GEOFenceViewController', '_initLeafletMap', 10);\n\t\t\t// }\n\n\t\t\tthis.map_html_id = 'map_' + ( new Date() ).getTime();\n\t\t\tDebug.Text( 'New Lmap id: ' + this.map_html_id, 'GEOFenceViewController.js', 'GEOFenceViewController', '_initLeafletMap', 10 );\n\n\t\t\t//append the map element, use then to ensure it's complete before initiallizing the map.\n\t\t\t$( '#tab_geo_fence:visible #map_container' ).html( '<div id=\"' + this.map_html_id + '\" class=\"google-map\"></div>' );\n\t\t\tthis.map_control = leaflet__WEBPACK_IMPORTED_MODULE_0___default().map( this.map_html_id, { layers: layers, minZoom: 2 } );\n\n\t\t\tDebug.Arr( this.map_control, 'Lmap var', 'GEOFenceViewController.js', 'GEOFenceViewController', '_initLeafletMap', 10 );\n\n\t\t\tif ( map_layers ) { //Add any Street/Satellite layers to the map if they are specified.\n\t\t\t\tleaflet__WEBPACK_IMPORTED_MODULE_0___default().control.layers( map_layers ).addTo( this.map_control );\n\t\t\t}\n\t\t}\n\n\t\tlayers[0].on( 'load', function() {\n\t\t\tTTPromise.resolve( 'Map', 'render' );\n\t\t} );\n\n\t\t//this.map_control.addLayer( layers[0] );\n\n\t\tthis.start_coordinates = this.startMapCoordinates();\n\n\t\tthis.map_control.setView( this.start_coordinates, 10 );\n\n\t\tthis.drawnItems = new (leaflet__WEBPACK_IMPORTED_MODULE_0___default().FeatureGroup)();\n\t\tthis.drawnItems.do_not_clear = true;\n\t\tthis.map_control.addLayer( this.drawnItems );\n\n\t\tthis.drawControl = new (leaflet__WEBPACK_IMPORTED_MODULE_0___default().Control.Draw)( {\n\t\t\tedit: {\n\t\t\t\tfeatureGroup: this.drawnItems,\n\t\t\t\tedit: false,\n\t\t\t\tremove: false\n\t\t\t},\n\t\t\tdraw: {\n\t\t\t\tpolygon: {\n\t\t\t\t\tshapeOptions: { color: '#0F820F' }\n\t\t\t\t},\n\t\t\t\tcircle: {\n\t\t\t\t\tshapeOptions: { color: '#0F820F' }\n\t\t\t\t},\n\t\t\t\tpolyline: false,\n\t\t\t\trectangle: false,\n\t\t\t\tmarker: false,\n\t\t\t\tcirclemarker: false\n\t\t\t}\n\t\t} );\n\n\t\tthis.map_control.addControl( this.drawControl );\n\n\t\tvar $this = this;\n\t\tthis.map_control.on( (leaflet__WEBPACK_IMPORTED_MODULE_0___default().Draw.Event.DRAWSTART), function( e ) {\n\t\t\t$this.removeAllLayers();\n\t\t} );\n\n\t\tthis.map_control.on( (leaflet__WEBPACK_IMPORTED_MODULE_0___default().Draw.Event.CREATED), function( e ) {\n\t\t\tvar type = e.layerType,\n\t\t\t\tnew_layer = e.layer;\n\t\t\tnew_layer.editable = true;\n\t\t\tnew_layer.removable = true;\n\n\t\t\t$this.removeAllLayers();\n\t\t\t$this._selectedShape = new_layer;\n\t\t\t$this.drawnItems.addLayer( new_layer );\n\t\t\tnew_layer.editing.enable();\n\t\t\t$this.is_changed = true;\n\t\t\t$this.setEditMenu();\n\t\t\t$this.validate();\n\t\t} );\n\n\t\tthis._initSearchBox();\n\t}\n\n\t_onShapeUpdate( e ) {\n\t\tvar edit_layer = e.target;\n\t\tedit_layer.editable = true;\n\t\tedit_layer.removable = true;\n\t\tthis._selectedShape = edit_layer;\n\t\tthis.drawnItems.addLayer( edit_layer );\n\t\tedit_layer.editing.enable();\n\t\tthis.is_changed = true;\n\t\tthis.setEditMenu();\n\t}\n\n\tremoveAllLayers() {\n\t\tfor ( var layer in this.drawnItems._layers ) {\n\t\t\tif ( this.drawnItems._layers[layer].removable == true ) {\n\t\t\t\ttry { //try needed for intermittent low-level non-blocking error when users navigate faster than leaflet can draw\n\t\t\t\t\tthis.drawnItems.removeLayer( this.drawnItems._layers[layer] );\n\t\t\t\t} catch ( e ) {\n\t\t\t\t\tDebug.Text( e.message, 'GeoFenceController.js', 'GeoFenceController', 'GeoFenceController', 10 );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tsuper.onFormItemChange( target, doNotValidate );\n\t\tvar key = target.getField();\n\t\tif ( key == 'geo_color' ) {\n\t\t\tthis.drawControl.options.draw.polygon.shapeOptions.color = this.edit_view_ui_dic[key].val();\n\t\t\tthis.drawControl.options.draw.circle.shapeOptions.color = this.edit_view_ui_dic[key].val();\n\n\t\t\tfor ( var layer in this.drawnItems._layers ) {\n\t\t\t\tif ( this.drawnItems._layers[layer].is_search_marker === undefined ) { // Only change the colours for layers that are not a search marker. Otherwise this will result in an error when changing colours after a search.\n\t\t\t\t\tthis.drawnItems._layers[layer].setStyle( {\n\t\t\t\t\t\tfillColor: this.edit_view_ui_dic[key].val(),\n\t\t\t\t\t\tcolor: this.edit_view_ui_dic[key].val()\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t_initSearchBox() {\n\t\tvar $this = this;\n\t\t$( '#pac-input' ).bind( 'focus', function( e ) {\n\t\t\t$( this ).select();\n\t\t} );\n\n\t\t$( '#pac-input' ).bind( 'keyup', function( e ) {\n\t\t\tif ( e.keyCode == 13 ) {\n\t\t\t\t$( '#suggestion-box div' ).first().click();\n\t\t\t} else {\n\t\t\t\t$this.search_key_delay = parseInt( Date.now() );\n\t\t\t\twindow.setTimeout( function() {\n\t\t\t\t\tif ( parseInt( Date.now() ) - $this.search_key_delay >= 250 ) {\n\t\t\t\t\t\t$this.stop_suggestions = false;\n\t\t\t\t\t\t_framework_leaflet_leaflet_timetrex__WEBPACK_IMPORTED_MODULE_3__.TTMapHelper.searchSuggest( $this, true );\n\t\t\t\t\t}\n\t\t\t\t}, 300 );\n\t\t\t}\n\t\t} );\n\t}\n\n\tsaveLayout() {\n\t\tvar $this = this;\n\t\tthis.user_generic_data_api.setUserGenericData( this.select_layout, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tif ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t\t\t$this.select_layout.id = result_data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tcenterMap() {\n\t\tthis.map_control.panTo( this.start_coordinates );\n\t}\n\n\tuniformVariable( record ) {\n\t\trecord.geo_circle = false;\n\t\trecord.geo_type_id = 10; // default to circle prevent \"Incorrect GEO type\" exception triggered.\n\t\trecord.map_level = false;\n\t\tif ( this._selectedShape && this._selectedShape._radius != undefined ) {\n\t\t\trecord.geo_circle = {};\n\t\t\trecord.geo_circle.center = [this._selectedShape.getLatLng().lat, this._selectedShape.getLatLng().lng];\n\t\t\trecord.geo_circle.radius = this._selectedShape._mRadius;\n\t\t\trecord.geo_type_id = 20;\n\t\t\trecord.map_level = this.map_control.getZoom();\n\t\t} else if ( this._selectedShape ) {\n\t\t\tvar latlngs = this._selectedShape.getLatLngs()[0]; //getPaths().getAt( 0 ).getArray();\n\t\t\tvar array = [];\n\t\t\tfor ( var i = 0; i < latlngs.length; i++ ) {\n\t\t\t\tarray.push( [latlngs[i].lat, latlngs[i].lng] );\n\t\t\t}\n\t\t\trecord.geo_polygon = array;\n\t\t\trecord.geo_type_id = 10;\n\t\t\trecord.map_level = this.map_control.getZoom();\n\t\t}\n\t\treturn record;\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tvar $this = this;\n\t\tthis.user_generic_data_api.getUserGenericData( { filter_data: { script: 'MapView', deleted: false } }, {\n\t\t\tonResult: function( results ) {\n\t\t\t\tvar result_data = results.getResult();\n\t\t\t\tif ( result_data && result_data.length > 0 ) {\n\t\t\t\t\t$this.select_layout = result_data[0];\n\t\t\t\t} else {\n\t\t\t\t\t$this.select_layout = {\n\t\t\t\t\t\tscript: 'MapView',\n\t\t\t\t\t\tis_default: false,\n\t\t\t\t\t\tname: Global.default_item,\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tmarker_connection_type: 'LINE'\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t//Set current edit record data to all widgets\n\t\t\t\t//$this._selectedShape && $this._deleteSelectShape();\n\t\t\t\tfor ( var key in $this.current_edit_record ) {\n\t\t\t\t\tif ( !$this.current_edit_record.hasOwnProperty( key ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tvar widget = $this.edit_view_ui_dic[key];\n\t\t\t\t\tif ( Global.isSet( widget ) ) {\n\t\t\t\t\t\tswitch ( key ) {\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\twidget.setValue( $this.current_edit_record[key] );\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( $this.drawnItems ) {\n\t\t\t\t\t$this.removeAllLayers();\n\t\t\t\t}\n\n\t\t\t\t$this.bounds = new (leaflet__WEBPACK_IMPORTED_MODULE_0___default().LatLngBounds)();\n\t\t\t\tif ( $this.current_edit_record.geo_type_id == 20 && $this.current_edit_record.geo_circle ) {\n\t\t\t\t\t$this._drawCircle( $this.current_edit_record.geo_circle );\n\t\t\t\t} else if ( $this.current_edit_record.geo_type_id == 10 && $this.current_edit_record.geo_polygon ) {\n\t\t\t\t\t$this._drawPolygon( $this.current_edit_record.geo_polygon );\n\t\t\t\t} else {\n\t\t\t\t\t$this.centerMap();\n\t\t\t\t}\n\n\t\t\t\t$this.current_edit_record.map_level = $this.map_control.getZoom();\n\n\t\t\t\t$this.collectUIDataToCurrentEditRecord();\n\t\t\t\t$this.setEditViewDataDone();\n\t\t\t}\n\t\t} );\n\t}\n\n\t_drawCircle( geo_circle ) {\n\t\tDebug.Text( 'drawing circle', 'GEOFenceViewController.js', 'GEOFenceViewController', '_drawCircle', 10 );\n\t\tvar layer = new (leaflet__WEBPACK_IMPORTED_MODULE_0___default().Circle)( [parseFloat( geo_circle.center[0] ), parseFloat( geo_circle.center[1] )], parseFloat( geo_circle.radius ), {\n\t\t\tstroke: true,\n\t\t\tfill: true,\n\t\t\topacity: 0.8,\n\t\t\tweight: 2,\n\t\t\tcolor: this.current_edit_record.geo_color ? '#' + this.current_edit_record.geo_color : '#0F820F',\n\t\t\tfillOpacity: 0.25,\n\t\t\tfillColor: this.current_edit_record.geo_color ? '#' + this.current_edit_record.geo_color : '#0F820F'\n\t\t} );\n\t\tlayer.removable = true;\n\t\tlayer.addTo( this.drawnItems );//.bindPopup(this.current_edit_record.name,{closeButton:false, className:'polypopup'}).openPopup();\n\n\t\tif ( this.is_edit ) {\n\t\t\tlayer.editing.enable();\n\t\t} else {\n\t\t\tlayer.editing.disable();\n\t\t}\n\n\t\tthis.map_control.fitBounds( layer.getBounds(), { padding: [20, 20] } );\n\t\tthis.geo_layers.push( layer );\n\t\tvar $this = this;\n\n\t\tlayer.on( 'edit', function( e ) {\n\t\t\t$this._onShapeUpdate( e );\n\t\t} );\n\t}\n\n\t_drawPolygon( triangleCoords ) {\n\t\tDebug.Text( 'drawing polygon', 'GEOFenceViewController.js', 'GEOFenceViewController', '_drawPolygon', 10 );\n\t\tvar latlngs = _.map( triangleCoords, function( item ) {\n\t\t\treturn { lat: parseFloat( item[0] ), lng: parseFloat( item[1] ) };\n\t\t} );\n\n\t\tvar layer = new (leaflet__WEBPACK_IMPORTED_MODULE_0___default().Polygon)( triangleCoords, {\n\t\t\tstroke: true,\n\t\t\tfill: true,\n\t\t\topacity: 0.8,\n\t\t\tweight: 2,\n\t\t\tcolor: this.current_edit_record.geo_color ? '#' + this.current_edit_record.geo_color : '#0F820F',\n\t\t\tfillOpacity: 0.25,\n\t\t\tfillColor: this.current_edit_record.geo_color ? '#' + this.current_edit_record.geo_color : '#0F820F'\n\t\t} );\n\t\tlayer.removable = true;\n\n\t\tif ( this.is_edit ) {\n\t\t\tlayer.editing.enable();\n\t\t} else {\n\t\t\tlayer.editing.disable();\n\t\t}\n\n\t\tlayer.addTo( this.drawnItems );//.bindPopup(this.current_edit_record.name,{closeButton:false, className:'polypopup'}).openPopup();\n\n\t\tthis.map_control.fitBounds( layer.getBounds(), { padding: [20, 20] } );\n\t\tthis.geo_layers.push( layer );\n\t\tvar $this = this;\n\n\t\tlayer.on( 'edit', function( e ) {\n\t\t\t$this._onShapeUpdate( e );\n\t\t} );\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'name',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tscript_name: 'EmployeeView',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tscript_name: 'EmployeeView',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\n\t\t];\n\t}\n\n\tsetEditMenuMapIcon( context_btn ) {\n\n\t\tif ( Global.getProductEdition() <= 10 ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t}\n\n\tsetDefaultMenuMapIcon( context_btn, grid_selected_length ) {\n\t\tif ( Global.getProductEdition() <= 10 ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( grid_selected_length > 0 ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditViewDataDone() {\n\t\tthis.is_edit = true;\n\t\tsuper.setEditViewDataDone();\n\t\tvar $this = this;\n\t\tTTPromise.wait( null, null, function() {\n\t\t\t//set the color of the polygon at the start\n\t\t\tif ( $this.edit_view_ui_dic.geo_color ) {\n\t\t\t\t$this.drawControl.options.draw.polygon.shapeOptions.color = $this.edit_view_ui_dic.geo_color.val();\n\t\t\t\t$this.drawControl.options.draw.circle.shapeOptions.color = $this.edit_view_ui_dic.geo_color.val();\n\t\t\t}\n\n\t\t} );\n\t}\n\n\tonSaveAndContinue( ignoreWarning ) {\n\t\tthis.removeAllLayers();\n\t\tsuper.onSaveAndContinue();\n\t}\n\n\tsetNavigation() {\n\n\t\tvar $this = this;\n\n\t\t//Error: Unable to get value of the property 'getGridParam': object is null or undefined in /interface/html5/views/BaseViewController.js?v=8.0.0-20141230-103725 line 2575\n\t\tif ( !this.grid ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.navigation.setPossibleDisplayColumns( this.buildDisplayColumnsByColumnModel( this.grid.grid.getGridParam( 'colModel' ) ),\n\t\t\tthis.buildDisplayColumns( this.default_display_columns ) );\n\n\t\tthis.navigation.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\n\t\t\tvar key = target.getField();\n\t\t\tvar next_select_item_id = target.getValue();\n\n\t\t\tif ( !next_select_item_id ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( next_select_item_id !== $this.current_edit_record.id ) {\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tTTPromise.add( 'Map', 'render' );\n\t\t\t\tif ( $this.is_viewing ) {\n\t\t\t\t\t$this.onViewClick( next_select_item_id ); //Dont refresh UI\n\t\t\t\t} else {\n\t\t\t\t\t$this.onEditClick( next_select_item_id ); //Dont refresh UI\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t//wait for map to render and prevent js exception from moving too fast.\n\t\t\tTTPromise.wait( 'Map', 'render', function() {\n\t\t\t\t$this.setNavigationArrowsEnabled();\n\t\t\t} );\n\n\t\t} );\n\n\t}\n\n\tgetGeoFenceTabHtml() {\n\t\treturn `<div id=\"tab_geo_fence\" class=\"edit-view-tab-outside\" style=\"height: 85%\">\n\t\t\t\t\t<div class=\"edit-view-tab\" id=\"tab_geo_fence_content_div\">\n\t\t\t\t\t\t<div class=\"first-column full-width-column\"></div>\n\t\t\t\t\t\t<input id=\"pac-input\" class=\"controls\" type=\"text\" placeholder=\"Address Search\" autocomplete=\"new-password\"> \x3c!-- Use 'new-password' as it disables auto-complete when 'off' does not --\x3e\n\t\t\t\t\t\t<div id=\"suggestion-box\"></div>\n\t\t\t\t\t\t<div id=\"map_container\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\t}\n}//# sourceURL=[module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