<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: select feature by url parameters in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-feature-by-url-parameters/m-p/1017337#M71396</link>
    <description>&lt;P&gt;It looks like you're already getting your query parameters and setting an expression. However, it doesn't look like you're doing anything to query or highlight the features. Take a look at &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/highlight-point-features/index.html" target="_self"&gt;this sample&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2021 19:22:45 GMT</pubDate>
    <dc:creator>BlakeTerhune</dc:creator>
    <dc:date>2021-01-15T19:22:45Z</dc:date>
    <item>
      <title>select feature by url parameters</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-feature-by-url-parameters/m-p/1017252#M71393</link>
      <description>&lt;P&gt;this my code and i want to use url parameters to select feature instead of just zoom to extent&lt;/P&gt;&lt;P&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;BR /&gt;&amp;lt;html&amp;gt;&lt;BR /&gt;&amp;lt;head&amp;gt;&lt;BR /&gt;&amp;lt;meta charset="utf-8"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"&amp;gt;&lt;BR /&gt;&amp;lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="apple-mobile-web-app-capable" content="yes"&amp;gt;&lt;BR /&gt;&amp;lt;meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"&amp;gt;&lt;BR /&gt;&amp;lt;title&amp;gt;مخططات عقارية&amp;lt;/title&amp;gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" href="css/style.css"&amp;gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" href="&lt;A href="https://js.arcgis.com/4.16/esri/themes/dark-blue/main.css" target="_blank"&gt;https://js.arcgis.com/4.16/esri/themes/dark-blue/main.css&lt;/A&gt;"&amp;gt;&lt;BR /&gt;&amp;lt;style&amp;gt;&lt;BR /&gt;&lt;BR /&gt;html, body, #viewDiv {&lt;BR /&gt;padding: 0;&lt;BR /&gt;margin: 0;&lt;BR /&gt;height: 100%;&lt;BR /&gt;width: 100%;&lt;BR /&gt;background-color: rgba(0, 0, 0, 1);&lt;BR /&gt;}&lt;BR /&gt;#titleDiv {&lt;BR /&gt;padding: 10px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;#titleText {&lt;BR /&gt;font-size: 20pt;&lt;BR /&gt;font-weight: 60;&lt;BR /&gt;padding-bottom: 10px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Style the buttons inside the tab */&lt;BR /&gt;.tab button {&lt;BR /&gt;background-color: rgb(0, 174, 255);&lt;BR /&gt;float: left;&lt;BR /&gt;border: none;&lt;BR /&gt;outline: none;&lt;BR /&gt;cursor: pointer;&lt;BR /&gt;padding: 14px 16px;&lt;BR /&gt;transition: 0.3s;&lt;BR /&gt;font-size: 15px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Change background color of buttons on hover */&lt;BR /&gt;.tab button:hover {&lt;BR /&gt;background-color: #ddd;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Create an active/current tablink class */&lt;BR /&gt;.tab button.active {&lt;BR /&gt;background-color: #fff;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Style the tab content */&lt;BR /&gt;.tabcontent {&lt;BR /&gt;background-color: #fff;&lt;BR /&gt;display: none;&lt;BR /&gt;padding: 6px 12px;&lt;BR /&gt;border: 1px solid #ccc;&lt;BR /&gt;border-top: none;&lt;BR /&gt;font-size: 20px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.esri-popup__main-container {&lt;BR /&gt;outline: none;&lt;BR /&gt;pointer-events: auto;&lt;BR /&gt;position: relative;&lt;BR /&gt;z-index: 1;&lt;BR /&gt;width: 340px;&lt;BR /&gt;max-height: 100px;&lt;BR /&gt;background-color: #000;&lt;BR /&gt;display: flex;&lt;BR /&gt;flex-flow: column nowrap;&lt;BR /&gt;}&lt;BR /&gt;.esri-widget {&lt;BR /&gt;box-sizing: border-box;&lt;BR /&gt;color: #f4f4f4;&lt;BR /&gt;font-size: 14px;&lt;BR /&gt;font-family: "Avenir Next W00","Helvetica Neue",Helvetica,Arial,sans-serif;&lt;BR /&gt;line-height: 1.3em;&lt;BR /&gt;background-color: #000;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.esri-popup__content {&lt;BR /&gt;display: flex;&lt;BR /&gt;flex-flow: column nowrap;&lt;BR /&gt;flex: 1 1 auto;&lt;BR /&gt;font-size: 12px;&lt;BR /&gt;font-weight: 400;&lt;BR /&gt;margin: 0 15px 0px;&lt;BR /&gt;overflow: auto;&lt;BR /&gt;line-height: normal;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[class*="esri-popup--aligned-bottom-"] .esri-popup__footer {&lt;BR /&gt;border-bottom: solid 0px rgba(0,0,0,1);&lt;BR /&gt;}&lt;BR /&gt;.esri-popup__footer {&lt;BR /&gt;align-items: center;&lt;BR /&gt;display: none;&lt;BR /&gt;flex: 1 1auto;&lt;BR /&gt;justify-content: space-between;&lt;BR /&gt;padding: 0px 0;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;.esri-view-height-less-than-medium .esri-popup__main-container {&lt;BR /&gt;max-height: 110px;&lt;BR /&gt;}&lt;BR /&gt;.esri-view-width-xlarge .esri-popup__main-container {&lt;BR /&gt;width: 340px;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;li {&lt;BR /&gt;list-style-type: none;&lt;BR /&gt;}&lt;BR /&gt;.esri-ui-corner .esri-component {&lt;BR /&gt;box-shadow: 0 0px 0px rgba(0, 0, 0, 0.3);&lt;BR /&gt;}&lt;BR /&gt;&amp;lt;/style&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;script src="&lt;A href="https://community.esri.com/" target="_blank"&gt;https://js.arcgis.com/4.16/"&amp;gt;&amp;lt;/script&lt;/A&gt;&amp;gt;&lt;BR /&gt;&amp;lt;script&amp;gt;&lt;BR /&gt;require([&lt;BR /&gt;"esri/WebMap",&lt;BR /&gt;"esri/widgets/BasemapGallery",&lt;BR /&gt;"esri/views/MapView",&lt;BR /&gt;"esri/layers/FeatureLayer",&lt;BR /&gt;"esri/widgets/Search",&lt;BR /&gt;"esri/widgets/LayerList",&lt;BR /&gt;"esri/widgets/Legend",&lt;BR /&gt;"esri/widgets/Home",&lt;BR /&gt;"esri/widgets/Expand" ,&lt;BR /&gt;], function(WebMap,BasemapGallery, MapView,FeatureLayer ,Search ,LayerList ,Legend ,Home&lt;BR /&gt;,Expand) {&lt;/P&gt;&lt;P&gt;var map = new WebMap({&lt;BR /&gt;portalItem: {&lt;BR /&gt;id: "db1d9f5508db440596c9af8e285cfda8"&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;var view = new MapView({&lt;BR /&gt;container: "viewDiv",&lt;BR /&gt;map: map,&lt;BR /&gt;center: [43.535531,29.610050],&lt;BR /&gt;zoom: 14,&lt;BR /&gt;ui: {&lt;BR /&gt;components: ["attribution"]&lt;BR /&gt;},&lt;BR /&gt;popup: {autoCloseEnabled :true,visibleElements : { featureNavigation :false ,&lt;BR /&gt;closeButton: false&lt;BR /&gt;},&lt;BR /&gt;dockEnabled: true,&lt;BR /&gt;dockOptions: {&lt;BR /&gt;// Disables the dock button from the popup&lt;BR /&gt;buttonEnabled: false,&lt;BR /&gt;// Ignore the default sizes that trigger responsive docking&lt;BR /&gt;breakpoint: true,&lt;BR /&gt;position :"bottom-center",&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt;view.popup.viewModel.actions.getItemAt(0).visible = false;&lt;BR /&gt;var myPopupTemplate = {&lt;BR /&gt;title:"",&lt;BR /&gt;content: "&amp;lt;img src='&lt;A href="https://i.ibb.co/bvNj8CL/logos4.jpg" target="_blank"&gt;https://i.ibb.co/bvNj8CL/logos4.jpg&lt;/A&gt;' align=right width=69px height=auto &amp;gt;"+"&amp;lt;ul text-align=right' 'style=list-style:none; dir='rtl' &amp;gt;"+&lt;BR /&gt;" &amp;lt; 'style=list-style-type: none;'&amp;gt;&amp;lt;b&amp;gt;"+" &amp;lt;a href= '&lt;A href="https://wa.me/?text=https://rbw.sa/public/rwf/V/index.html" target="_blank"&gt;https://wa.me/?text=https://rbw.sa/public/rwf/V/index.html&lt;/A&gt;' data-action= 'share/whatsapp/share' target='_blank'&amp;gt; &amp;lt;img src='&lt;A href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRJj4MNsTON-A716UUH8HrPXWAkiOsEuLL2bg&amp;amp;usqp=CAU" target="_blank"&gt;https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRJj4MNsTON-A716UUH8HrPXWAkiOsEuLL2bg&amp;amp;usqp=CAU&lt;/A&gt;' align=left style='margin-left:130px' width=20px display=inline; /&amp;gt; &amp;lt;/a&amp;gt;"+"&amp;lt;li&amp;gt;&amp;lt;a style='text-align:right margin-right:16px ;color:white'&amp;gt;{TxtMemo} &amp;lt;/a&amp;gt; &amp;lt;a href ='{GM}' &amp;gt;&amp;lt;img src='&lt;A href="https://community.esri.com/" target="_blank"&gt;https://i.ibb.co/58ppXrY/gm3.png'&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/li&lt;/A&gt;&amp;gt; "+"&amp;lt;li&amp;gt;&amp;lt;a style='text-align:right margin-right:12px; color:white'&amp;gt;&amp;lt;b&amp;gt; {Area} &amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;"+"&amp;lt;li&amp;gt;&amp;lt;a style='text-align:right margin-right:12px ;color:white'&amp;gt;&amp;lt;b&amp;gt;{Price} &amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;"+&lt;BR /&gt;"&amp;lt;li style=list-style-type: none; &amp;gt;&amp;lt;b&amp;gt; &amp;lt;a href='tel:{Call_Number}' style='text-align:right ;margin-right:26px';&amp;gt;{Call_Number} &amp;lt;/a&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/li&amp;gt;"+"&amp;lt;/ul&amp;gt;"&lt;BR /&gt;} ;&lt;BR /&gt;var labelClass =&lt;BR /&gt;{&lt;BR /&gt;symbol:&lt;BR /&gt;{&lt;BR /&gt;type: "text",&lt;/P&gt;&lt;P&gt;font:{&lt;BR /&gt;size:7.5,&lt;BR /&gt;weight: "bold"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;labelPlacement: "always-horizontal",&lt;BR /&gt;labelExpressionInfo:&lt;BR /&gt;{&lt;BR /&gt;expression: "$feature.رقم_القطعة"&lt;BR /&gt;},&lt;BR /&gt;maxScale: 0,&lt;BR /&gt;minScale: 8000,&lt;BR /&gt;};&lt;BR /&gt;var labelClass2 =&lt;BR /&gt;{&lt;BR /&gt;symbol:&lt;BR /&gt;{&lt;BR /&gt;type: "text",&lt;BR /&gt;color:"white",&lt;BR /&gt;haloColor: "black",&lt;BR /&gt;haloSize: 1,&lt;BR /&gt;font:{&lt;BR /&gt;size:10,&lt;BR /&gt;weight: "bold"&lt;BR /&gt;}&lt;BR /&gt;},&lt;BR /&gt;labelPlacement: "above-center",&lt;BR /&gt;labelExpressionInfo:&lt;BR /&gt;{&lt;BR /&gt;expression: "$feature.Names"&lt;BR /&gt;},&lt;BR /&gt;maxScale: 0,&lt;BR /&gt;minScale: 9000,&lt;BR /&gt;};&lt;BR /&gt;if ('URLSearchParams' in window) { // Feature detection (URLSearchParams is not supported by Internet Explorer)&lt;BR /&gt;var url = new URL(document.URL);&lt;BR /&gt;var search_params = url.searchParams;&lt;BR /&gt;if(search_params.has('m')) {&lt;BR /&gt;var mylayerz = search_params.get('m');&lt;BR /&gt;var expr = "OBJECTID = '" +mylayerz + "'";&lt;BR /&gt;} else {&lt;BR /&gt;var mylayerz = "";&lt;BR /&gt;var expr = "2=2";&lt;BR /&gt;}&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;var mylayer= new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services6.arcgis.com/f6IbF4Mn2X25xEIp/arcgis/rest/services/rbbgdb/FeatureServer/0&amp;quot;,definitionExpression" target="_blank"&gt;https://services6.arcgis.com/f6IbF4Mn2X25xEIp/arcgis/rest/services/rbbgdb/FeatureServer/0",definitionExpression&lt;/A&gt;: expr,&lt;BR /&gt;title:"OBJECTID" +mylayerz ,popupTemplate: myPopupTemplate,labelingInfo: [labelClass],outFields: ["TxtMemo","OBJECTID","إسم_المعلم"],&lt;BR /&gt;});&lt;BR /&gt;map.add(mylayer);&lt;BR /&gt;var mylayer2= new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services6.arcgis.com/f6IbF4Mn2X25xEIp/arcgis/rest/services/rbbgdb/FeatureServer/1" target="_blank"&gt;https://services6.arcgis.com/f6IbF4Mn2X25xEIp/arcgis/rest/services/rbbgdb/FeatureServer/1&lt;/A&gt;",&lt;BR /&gt;labelingInfo: [labelClass2]&lt;BR /&gt;});&lt;BR /&gt;map.add(mylayer2);&lt;BR /&gt;var mylayer1 = new FeatureLayer({&lt;BR /&gt;url: "&lt;A href="https://services6.arcgis.com/f6IbF4Mn2X25xEIp/arcgis/rest/services/rbbgdb/FeatureServer/2" target="_blank"&gt;https://services6.arcgis.com/f6IbF4Mn2X25xEIp/arcgis/rest/services/rbbgdb/FeatureServer/2&lt;/A&gt;"&lt;BR /&gt;});&lt;BR /&gt;map.add(mylayer1);&lt;BR /&gt;view.popup.watch("selectedFeature", function(graphic){&lt;BR /&gt;if(graphic.layer === mylayer){&lt;BR /&gt;view.popup.triggerAction(0); //This calls the popup Zoom To action&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;var searchWidget = new Search({&lt;BR /&gt;view: view,&lt;BR /&gt;sources: [&lt;BR /&gt;{&lt;BR /&gt;layer: mylayer,&lt;BR /&gt;searchFields: ["TxtMemo","OBJECTID","إسم_المعلم"],&lt;BR /&gt;displayField: ("TxtMemo","OBJECTID","إسم_المعلم"),&lt;BR /&gt;exactMatch: false,&lt;BR /&gt;outFields: ["TxtMemo","OBJECTID","إسم_المعلم"],&lt;BR /&gt;name:" ابحث في مخطط المحمدية",&lt;BR /&gt;placeholder: "example: 1080",&lt;BR /&gt;}&lt;BR /&gt;],&lt;BR /&gt;includeDefaultSources: false,&lt;BR /&gt;});&lt;BR /&gt;var layerList = new LayerList({&lt;BR /&gt;view: view,&lt;BR /&gt;});&lt;BR /&gt;var expand12 = new Expand({ expandIconClass:"esri-icon-maps",&lt;BR /&gt;view: view,&lt;BR /&gt;content:layerList,&lt;BR /&gt;Group:"top-left"&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;var homeWidget = new Home({&lt;BR /&gt;view: view&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;var legend = new Legend({&lt;BR /&gt;view: view,&lt;BR /&gt;layerInfos: [&lt;BR /&gt;{&lt;BR /&gt;layer:mylayer,&lt;BR /&gt;title:"مخطط المحمدية"&lt;BR /&gt;},&lt;BR /&gt;],&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;var expand2 = new Expand({&lt;BR /&gt;view: view,&lt;BR /&gt;content:searchWidget,&lt;BR /&gt;Group:"top-right"&lt;BR /&gt;});&lt;BR /&gt;var expand3= new Expand({&lt;BR /&gt;view: view,&lt;BR /&gt;content:legend,&lt;BR /&gt;group: "bottom-right",&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;view.ui.add("nav", "top-left");&lt;BR /&gt;mylayer&lt;BR /&gt;.when(function( ) {&lt;BR /&gt;&lt;BR /&gt;return mylayer.query();&lt;BR /&gt;&lt;BR /&gt;})&lt;BR /&gt;.then(function(response) {&lt;/P&gt;&lt;P&gt;view.goTo(response.query);&lt;BR /&gt;&lt;BR /&gt;});&lt;BR /&gt;&lt;BR /&gt;});&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;BR /&gt;&amp;lt;/head&amp;gt;&lt;BR /&gt;&amp;lt;body&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;div id="nav"&amp;gt;&lt;BR /&gt;&amp;lt;ul&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;li&amp;gt;&amp;lt;a href="Visitors_Combined.html"style="text-decoration:none;"&amp;gt;&amp;lt;b&amp;gt;قوقل مابس&amp;lt;/b&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/ul&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/html&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 15:43:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-feature-by-url-parameters/m-p/1017252#M71393</guid>
      <dc:creator>soma3</dc:creator>
      <dc:date>2021-01-15T15:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: select feature by url parameters</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-feature-by-url-parameters/m-p/1017337#M71396</link>
      <description>&lt;P&gt;It looks like you're already getting your query parameters and setting an expression. However, it doesn't look like you're doing anything to query or highlight the features. Take a look at &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/highlight-point-features/index.html" target="_self"&gt;this sample&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 19:22:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/select-feature-by-url-parameters/m-p/1017337#M71396</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2021-01-15T19:22:45Z</dc:date>
    </item>
  </channel>
</rss>

