{"id":10039,"date":"2020-03-27T10:28:55","date_gmt":"2020-03-27T01:28:55","guid":{"rendered":"http:\/\/www.gisdeveloper.co.kr\/?p=10039"},"modified":"2020-07-27T10:40:16","modified_gmt":"2020-07-27T01:40:16","slug":"fingereyes-xr%ec%97%90%ec%84%9c-%ec%86%8d%ec%84%b1%ea%b0%92%ec%9c%bc%eb%a1%9c-%eb%8f%84%ed%98%95-%ec%8b%ac%eb%b2%8c-%eb%b0%8f-%eb%9d%bc%eb%b2%a8%eb%ac%b8%ec%9e%90%ec%97%b4-%ec%84%a4%ec%a0%95%ed%95%98","status":"publish","type":"post","link":"http:\/\/www.gisdeveloper.co.kr\/?p=10039","title":{"rendered":"FingerEyes-Xr\uc5d0\uc11c \uc18d\uc131\uac12\uc73c\ub85c \ub3c4\ud615 \uc2ec\ubc8c \ubc0f \ub77c\ubca8\ubb38\uc790\uc5f4 \uc124\uc815\ud558\uae30"},"content":{"rendered":"<p>\uc5ec\ub7ec \uac1c\uc758 \uc18d\uc131\uac12\uc73c\ub85c \ub77c\ubca8 \ubb38\uc790\uc5f4\uc744 \uc870\ub9bd\ud558\uc5ec \uc2e4\uc81c \ud45c\uc2dc\ub418\ub294 \ub77c\ubca8\uc744 \uacb0\uc815\ud558\ub294 \ucf54\ub4dc\uc758 \uc608\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nCustomLabelFormatter = Xr.Class({\r\n    name: \"CustomLabelFormatter\",\r\n    extend: Xr.label.ProgrammableLabelFormatter,\r\n    requires: [Xr.label.ILabelFormatter],\r\n    construct: function (layer) {\r\n        this.superclass(layer);\r\n        this._MGN_CD = -1;\r\n        this._MGN_DT = -1;\r\n        this._codeValues = {\r\n            'C01': '\uc2dc\uc124A',\r\n            'C02': '\uc2dc\uc124B',\r\n            'P01': '\uc2dc\uc124C',\r\n            'P03': '\uc2dc\uc124D',\r\n            'R03': '\uc2dc\uc124E',\r\n            'T01': '\uc2dc\uc124F'\r\n        };\r\n    },\r\n    methods: {\r\n        value: function (shapeRow, fieldSet, attributeRow) {\r\n            if (this._EQMT_FIXPLC_RGN_SE_CD == -1) {\r\n                this._EQMT_FIXPLC_RGN_SE_CD = fieldSet.fieldIndex(\"MGN_CD\");\r\n            }\r\n\r\n            if (this._FST_REGI_TSP == -1) {\r\n                this._FST_REGI_TSP = fieldSet.fieldIndex(\"_MGN_DT\");\r\n            }\r\n\r\n            let code = attributeRow.valueAsString(this._MGN_CD);\r\n\r\n            \/\/ \ud544\ub4dc 2\uac1c\uc758 \uac12(_MGN_CD \ud544\ub4dc\uc758 \ucf54\ub4dc\uac12 + _MGN_DT \uc758 \uac12)\uc744 \uc870\ud569\ud55c \ub77c\ubca8 \ud45c\uc2dc, \uc608: \uc2dc\uc124B(2020-07-27 14:32:32)\r\n            return this._codeValues[code] + \"(\" + attributeRow.valueAsString(this._MGN_DT) + \")\";\r\n        }\r\n    }\r\n});\r\n\r\nvar lyr = new Xr.layers.ShapeMapLayer(\"lyr\", ...);\r\nlet label = lyr.label();\r\nlabel.enable(true);\r\n\r\nlet formatter = new CustomLabelFormatter(lyr);\r\nlabel.formatter(formatter);\r\n\r\nlm.add(lyr);\r\n<\/pre>\n<p>\ub2e4\uc74c\uc740 \uc18d\uc131\uac12\uc73c\ub85c \ub3c4\ud615\uc758 \uc2a4\ud0c0\uc77c \uc2ec\ubc8c\uc744 \uc9c0\uc815\ud558\ub294 \ucf54\ub4dc\uc758 \uc608\uc785\ub2c8\ub2e4.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"js\">\r\nCustomLayerTheme = Xr.Class({\r\n    name: \"CustomLayerTheme\",\r\n    extend: Xr.theme.ProgrammableShapeDrawTheme,\r\n    requires: [Xr.theme.IShapeDrawTheme],\r\n    construct: function (\/* ShapeMapLayer *\/ layer) {\r\n        this.superclass(layer);\r\n        this._fieldIndex = -1;\r\n        let codes = ['R01', 'P02', 'R03', 'P01', 'P02', 'T01', 'T02', 'C01', 'C02'];\r\n        let colors = ['#f1c40f', '#f39c12', '#e67e22', '#e74c3c', '#c0392b', '#ff0000', '#00ff00', '#0000ff', '#ff00ff'];\r\n        let symbols = [];\r\n        let cntCodes = codes.length;\r\n        for (let i = 0; i < cntCodes; i++) {\r\n            let SDS = new Xr.symbol.ShapeDrawSymbol();\r\n            SDS.brushSymbol().color(colors[i]).opacity(0.5);\r\n            SDS.penSymbol().color(colors[i]).width(2);\r\n\r\n            let symbol = {\r\n                code: codes[i],\r\n                symbol: SDS\r\n            };\r\n\r\n            symbols[i] = symbol;\r\n        }\r\n\r\n        this._symbols = symbols;\r\n    },\r\n    methods: {\r\n\/* ShapeDrawSymbol *\/ symbol: function (\/* ShapeRow *\/ shapeRow, \/* FieldSet *\/ fieldSet, \/* AttributeRow *\/ attributeRow) {\r\n            if (this._fieldIndex === -1) {\r\n                this._fieldIndex = fieldSet.fieldIndex(\"MGN_CD\");\r\n            }\r\n\r\n            let value = attributeRow.valueAsString(this._fieldIndex);\r\n            let symbols = this._symbols;\r\n            let symbol = undefined;\r\n            let cntSymbols = symbols.length;\r\n            for (var i = 0; i < cntSymbols; i++) {\r\n                symbol = symbols[i];\r\n                if (value === symbol.code) {\r\n                    break;\r\n                }\r\n            }\r\n            return symbol.symbol;\r\n        },\r\n\r\n\/* boolean *\/ needAttribute: function () {\r\n            return true;\r\n        }\r\n    }\r\n});\r\n\r\n\r\nvar lyr = new Xr.layers.ShapeMapLayer(\"lyr\", ...);\r\n\r\nvar newTheme = new CustomLayerTheme(lyr)\r\nlyr.theme(newTheme);\r\n\r\nlm.add(lyr);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uc5ec\ub7ec \uac1c\uc758 \uc18d\uc131\uac12\uc73c\ub85c \ub77c\ubca8 \ubb38\uc790\uc5f4\uc744 \uc870\ub9bd\ud558\uc5ec \uc2e4\uc81c \ud45c\uc2dc\ub418\ub294 \ub77c\ubca8\uc744 \uacb0\uc815\ud558\ub294 \ucf54\ub4dc\uc758 \uc608\uc785\ub2c8\ub2e4. CustomLabelFormatter = Xr.Class({ name: &#8220;CustomLabelFormatter&#8221;, extend: Xr.label.ProgrammableLabelFormatter, requires: [Xr.label.ILabelFormatter], construct: function (layer) { this.superclass(layer); this._MGN_CD = -1; this._MGN_DT = -1; this._codeValues = { &#8216;C01&#8217;: &#8216;\uc2dc\uc124A&#8217;, &#8216;C02&#8217;: &#8216;\uc2dc\uc124B&#8217;, &#8216;P01&#8217;: &#8216;\uc2dc\uc124C&#8217;, &#8216;P03&#8217;: &#8216;\uc2dc\uc124D&#8217;, &#8216;R03&#8217;: &#8216;\uc2dc\uc124E&#8217;, &#8216;T01&#8217;: &#8216;\uc2dc\uc124F&#8217; }; }, methods: { value: function (shapeRow, fieldSet, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/www.gisdeveloper.co.kr\/?p=10039\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FingerEyes-Xr\uc5d0\uc11c \uc18d\uc131\uac12\uc73c\ub85c \ub3c4\ud615 \uc2ec\ubc8c \ubc0f \ub77c\ubca8\ubb38\uc790\uc5f4 \uc124\uc815\ud558\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-10039","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10039"}],"version-history":[{"count":3,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10039\/revisions"}],"predecessor-version":[{"id":10042,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/10039\/revisions\/10042"}],"wp:attachment":[{"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10039"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gisdeveloper.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}