{"id":2883,"date":"2025-11-12T09:55:26","date_gmt":"2025-11-12T02:55:26","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/?post_type=docs&#038;p=2883"},"modified":"2025-11-12T09:55:26","modified_gmt":"2025-11-12T02:55:26","slug":"identifyutil","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/android\/map\/identifyutil\/","title":{"rendered":"IdentifyUtil"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"identifyutil\">IdentifyUtil<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"variables-class\">Variables class<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><th>Variable Type<\/th><\/tr><\/thead><tbody><tr><td>JSON_RESULT<\/td><td>String &#8220;results&#8221; \u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 IdentifyCallback<\/td><td>String<\/td><td>&#8220;results&#8221;<\/td><td>var<\/td><\/tr><tr><td>JSON_MESSAGE<\/td><td>String &#8220;message&#8221; \u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 IdentifyCallback<\/td><td>String<\/td><td>&#8220;message&#8221;<\/td><td>var<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-overview\">Method Overview<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Return<\/th><\/tr><\/thead><tbody><tr><td>callIdentifyService()<\/td><td>\u0e2a\u0e23\u0e49\u0e32\u0e07 Folder file<\/td><td>Call&lt; JsonObject &gt;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-details\">Method Details<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun callIdentifyService(apiInterface: ApiInterface , \n                        mapServiceUrl: String, \n                        params: HashMap&lt;String, Any>): Call&lt;JsonObject><\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">callIdentifyService<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">apiInterface<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">ApiInterface<\/span><span style=\"color: #000000\"> , <\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                        <\/span><span style=\"color: #001080\">mapServiceUrl<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\">, <\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                        <\/span><span style=\"color: #001080\">params<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">HashMap<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\">, <\/span><span style=\"color: #001080\">Any<\/span><span style=\"color: #000000\">&gt;): <\/span><span style=\"color: #001080\">Call<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #001080\">JsonObject<\/span><span style=\"color: #000000\">&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07 Request \u0e17\u0e35\u0e48\u0e08\u0e30 Identify<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters\">Parameters<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><\/tr><\/thead><tbody><tr><td>apiInterface<\/td><td>apiInterface \u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e40\u0e23\u0e35\u0e22\u0e01 Service \u0e40\u0e0a\u0e48\u0e19 Retrofit<\/td><td>ApiInterface<\/td><\/tr><tr><td>mapServiceUrl<\/td><td>String url \u0e02\u0e2d\u0e07 Map Service<\/td><td>String<\/td><\/tr><tr><td>params<\/td><td>Parameters \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23 Identify<\/td><td>HashMap&lt; String, Any &gt;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns\">Returns<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Call&lt; JsonObject &gt;<\/td><td>Return Call \u0e17\u0e35\u0e48\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e44\u0e1b\u0e2a\u0e25\u0e31\u0e1a Thread \u0e15\u0e48\u0e2d\u0e44\u0e14\u0e49\u0e41\u0e25\u0e49\u0e27\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e1a IdentifyCallback \u0e44\u0e14\u0e49\u0e2d\u0e35\u0e01\u0e14\u0e49\u0e27\u0e22<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"example\">Example<\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-Fira-Code\" style=\"font-size:.875rem;font-family:Code-Pro-Fira-Code,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>IdentifyUtil.callIdentifyService(apiInterface,mapUrl,params).enqueue(object :\n            IdentifyCallback&lt;JsonObject>() {\n\n            override fun onSuccess(response: JsonObject) {\n                val features = response.get(JSON_RESULT).asJsonArray\n                if(features.size() != 0){ \/\/check feture size\n\n                    \/\/feture size is not empty.\n                    \/\/ doing something\n\n                } else {\n\n                    \/\/feature is empty.\n\n                }\n            }\n\n            override fun onFailure(t: Throwable) {\n                \/\/ handle error\n            }\n\n        })<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">IdentifyUtil<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">callIdentifyService<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">apiInterface<\/span><span style=\"color: #000000\">,<\/span><span style=\"color: #001080\">mapUrl<\/span><span style=\"color: #000000\">,<\/span><span style=\"color: #001080\">params<\/span><span style=\"color: #000000\">).<\/span><span style=\"color: #795E26\">enqueue<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">object<\/span><span style=\"color: #000000\"> :<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            <\/span><span style=\"color: #795E26\">IdentifyCallback<\/span><span style=\"color: #000000\">&lt;<\/span><span style=\"color: #267F99\">JsonObject<\/span><span style=\"color: #000000\">&gt;() {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            override fun <\/span><span style=\"color: #795E26\">onSuccess<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">response<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #267F99\">JsonObject<\/span><span style=\"color: #000000\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #001080\">val<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #001080\">features<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #001080\">response<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">get<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #0070C1\">JSON_RESULT<\/span><span style=\"color: #000000\">).<\/span><span style=\"color: #001080\">asJsonArray<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #AF00DB\">if<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">features<\/span><span style=\"color: #000000\">.<\/span><span style=\"color: #795E26\">size<\/span><span style=\"color: #000000\">() != <\/span><span style=\"color: #098658\">0<\/span><span style=\"color: #000000\">){ <\/span><span style=\"color: #008000\">\/\/check feture size<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                    <\/span><span style=\"color: #008000\">\/\/feture size is not empty.<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                    <\/span><span style=\"color: #008000\">\/\/ doing something<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                } <\/span><span style=\"color: #AF00DB\">else<\/span><span style=\"color: #000000\"> {<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                    <\/span><span style=\"color: #008000\">\/\/feature is empty.<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                }<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            override fun <\/span><span style=\"color: #795E26\">onFailure<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">t<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #267F99\">Throwable<\/span><span style=\"color: #000000\">) {<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">                <\/span><span style=\"color: #008000\">\/\/ handle error<\/span><\/span>\n<span class=\"line\"><span style=\"color: #000000\">            }<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #000000\">        })<\/span><\/span><\/code><\/pre><\/div>\n","protected":false},"featured_media":0,"parent":2835,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-2883","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2883","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=2883"}],"version-history":[{"count":1,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2883\/revisions"}],"predecessor-version":[{"id":2884,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2883\/revisions\/2884"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2835"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=2883"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=2883"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}