<?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: Has anyone had success integrating the Javascript API (4.6) with Drupal 7x? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/has-anyone-had-success-integrating-the-javascript/m-p/479447#M44570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I will answer my own question after a few days of toiling over this. Drupal 7 is not friendly to the DOM and blasts it from left and right with all kinds of stuff, so the key is to get the Esri&amp;nbsp;scripts and your custom scripts loaded at the same time which, for Drupal, means in the same file. There are other ways of doing this, but not without a lot of Drupal headaches. So!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;1. Create your Drupal module.&lt;/STRONG&gt; I created a module called "find_my_leg" which is short for "Find My Legislator." Directory/file structure looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;modules/custom/find_my_leg&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/find_my_leg.info&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/find_my_leg.module&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/theme.inc&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/js/findmyleg.js&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/templates&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/templates/find_my_leg_page.tpl.php&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;2. Write your map code.&lt;/STRONG&gt; The only three files I'll provide code for here are "find_my_leg_page.tpl.php", "findmyleg.js," and "find_my_leg.module." The others are out of the scope of this post. Check Drupal 7 docs for more info.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;-------------------------------&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;find_my_leg_page.tpl.php&lt;/STRONG&gt;

&amp;lt;link rel="stylesheet"&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.6%2Fesri%2Fcss%2Fmain.css" target="_blank"&gt;https://js.arcgis.com/4.6/esri/css/main.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;lt;script defer src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.6%2F" target="_blank"&gt;https://js.arcgis.com/4.6/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;
&amp;lt;script defer src="/sites/all/modules/custom/find_my_leg/theme/js/findmyleg.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;!-- Replace these with your own styles --&amp;gt;
&amp;lt;style&amp;gt;

main#main-content.main-content{
width: 100%;
margin-top: -50px;
}

#viewDiv {
 border: 1px solid #ccc;
 padding: 0px;
 margin: 0;
 height: 600px;
 width: 100%;
}

.findLegContainer {
 display: grid;
 grid-template-columns: 60px auto;
 grid-gap: 10px;
 width: 100%;
}

.findLegContainer &amp;gt; div {
 text-align: left;
}

img.headshot {
 width: 100%;
 height: auto;
 margin-bottom: 10px;
}
&amp;lt;/style&amp;gt;
&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;

&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;findmyleg.js&lt;/STRONG&gt;


require([
 "esri/Map",
 "esri/views/MapView",
 "esri/layers/FeatureLayer",
 "esri/widgets/Legend",
 "esri/tasks/Locator",
 "esri/widgets/Search",
 "esri/tasks/QueryTask",
 "esri/tasks/support/Query",
 "dojo/domReady!"
 ], function(
 Map, MapView, FeatureLayer, Legend, Locator, Search, QueryTask, Query
 ) {
 
 //REST endpoints
 var senateServiceUrl = "Your REST endpoint for your senate data";
 var houseServiceUrl = "Your REST endpoint for your house data";
 var locatorServiceUrl = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer";
 
 //Layer fill and lines
 var houseFill = {
 type: "simple-fill", // autocasts as new SimpleFillSymbol()
 style: "none",
 outline: { // autocasts as new SimpleLineSymbol()
 color: [165, 223, 65, 1],
 width: 1
 }
 };
 
 var senateFill = {
 type: "simple-fill", // autocasts as new SimpleFillSymbol()
 style: "none",
 outline: { // autocasts as new SimpleLineSymbol()
 color: [33, 151, 212, 1],
 width: 1
 }
 };
 
 //Renderers
 var houseRenderer = {
 type: "simple", // autocasts as new SimpleRenderer()
 symbol: houseFill
 };
 
 var senateRenderer = {
 type: "simple", // autocasts as new SimpleRenderer()
 symbol: senateFill
 };
 
 
 // Create the PopupTemplates
 var senatePopupTemplate = { // autocasts as new PopupTemplate()
 title: "Senator {FIRST_NAME} {LAST_NAME}",
 content: "&amp;lt;div class='findLegContainer'&amp;gt;&amp;lt;div&amp;gt;&amp;lt;img class='headshot' src='/sites/default/files/{MEMBER_PICTURE}' /&amp;gt;&amp;lt;/div&amp;gt;" +
 "&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;{CHAMBER}enate District {DISTRICT} &amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;" +
 "E-mail: &amp;lt;a href='mailto: {EMAIL}'&amp;gt;{EMAIL}&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;" +
 "Webpage: &amp;lt;a href='https://community.esri.com/node/{WEBSITE}' target='_blank'&amp;gt;{FIRST_NAME} {LAST_NAME}&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;"
 };
 
 var housePopupTemplate = { // autocasts as new PopupTemplate()
 title: "Representative {FIRST_NAME} {LAST_NAME}",
 content: "&amp;lt;div class='findLegContainer'&amp;gt;&amp;lt;div&amp;gt;&amp;lt;img class='headshot' src='/sites/default/files/{MEMBER_PICTURE}' /&amp;gt;&amp;lt;/div&amp;gt;" +
 "&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;{CHAMBER}ouse District {DISTRICT} &amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;" +
 "E-mail: &amp;lt;a href='mailto: {EMAIL}'&amp;gt;{EMAIL}&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;" +
 "Webpage: &amp;lt;a href='https://community.esri.com/node/{WEBSITE}' target='_blank'&amp;gt;{FIRST_NAME} {LAST_NAME}&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;" 
 };
 
 //Create Feature Layers
 var houseLyr = new FeatureLayer({
 url: houseServiceUrl,
 renderer: houseRenderer,
 popupTemplate: housePopupTemplate,
 legendEnabled: true,
 outFields: ["*"]
 });
 
 var senateLyr = new FeatureLayer({
 url: senateServiceUrl,
 renderer: senateRenderer,
 popupTemplate: senatePopupTemplate,
 outFields: ["*"]
 });
 
 //Instantiate map
 var map = new Map({
 basemap: "streets",
 layers: [houseLyr, senateLyr]
 });
 
 //Instantiate map view
 var view = new MapView({
 container: "viewDiv",
 map: map,
 center: [-105.358887, 39.113014],
 zoom: 7,
 popup: {
 //features: legPopups,
 dockEnabled: false,
 dockOptions: {
 buttonEnabled: false,
 breakpoint: false
 }
 }
 });

//Search widget
 var searchWidget = new Search({ 
 view: view,
 AllPlaceholder: "Rep or Senator Last Name",
 sources: [{
 locator: new Locator({ url: locatorServiceUrl }),
 singleLineFieldName: "SingleLine",
 name: "Place",
 localSearchOptions: {
 minScale: 300000,
 distance: 50000
 },
 placeholder: "Search Geocoder",
 maxResults: 3,
 maxSuggestions: 6,
 suggestionsEnabled: true,
 minSuggestCharacters: 0
 },
 {
 featureLayer: houseLyr,
 searchFields: ["LAST_NAME"],
 displayField: "LAST_NAME",
 exactMatch: false,
 outFields: ["*"],
 name: "House Members",
 maxResults: 10,
 maxSuggestions: 10,
 suggestionsEnabled: true,
 minSuggestCharacters: 0,
 placeholder: "example: Duran"
 },
 {
 featureLayer: senateLyr,
 searchFields: ["LAST_NAME"],
 displayField: "LAST_NAME",
 exactMatch: false,
 outFields: ["*"],
 name: "Senate Members",
 placeholder: "example: Sonnenberg",
 maxResults: 6,
 maxSuggestions: 6,
 suggestionsEnabled: true,
 minSuggestCharacters: 0
 }]
 
 });
 
 
 /*var legend = new Legend({
 view: view,
 layerInfos: [{
 layer: houseLyr,
 title: "House Boundary Color"
 },{
 layer: senateLyr,
 title: "Senate Boundary Color"
 }
 ]
 });

view.ui.add(legend, "bottom-right");*/
 
 
 //Add the search widget
 view.ui.add(searchWidget, {
 position: "top-left",
 index: 0
 });
 
 //Move zoom button to top right
 view.ui.move("zoom", "top-right");

});

&lt;STRONG&gt;find_my_leg.module

&lt;/STRONG&gt;&amp;lt;?php

/*
 * @author Steve Peralta
 */

/*
 * Implements hook_menu().
 */
function find_my_leg_menu() {
 $items['findmylegislator'] = array(
 'title' =&amp;gt; 'Find My Legislator',
 'page callback' =&amp;gt; 'find_my_leg_page',
 'access callback' =&amp;gt; TRUE,
 'type' =&amp;gt; MENU_CALLBACK
 );
 
 
 return $items;
}

/**
 * Implements hook_theme()
 */
function find_my_leg_theme() {
 return array(
 'themekit' =&amp;gt; array(
 'render element' =&amp;gt; 'elements',
 'template' =&amp;gt; 'theme/templates/find_my_leg_page',
 ),
 );
}

/**
 * Page callback for /findmylegislator.
 */
function find_my_leg_page() {
 return theme('themekit');
}

&lt;/PRE&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;And that is it! I'm super new to Esri so there are some things to improve on here, I'm sure, but hope you get some use out of it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 21:09:48 GMT</pubDate>
    <dc:creator>StevePeralta</dc:creator>
    <dc:date>2021-12-11T21:09:48Z</dc:date>
    <item>
      <title>Has anyone had success integrating the Javascript API (4.6) with Drupal 7x?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/has-anyone-had-success-integrating-the-javascript/m-p/479446#M44569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;I was getting a "dojo.js:24 Error: multipleDefine" and then I moved "&amp;lt;script defer src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.6%2F" rel="nofollow" target="_blank"&gt;https://js.arcgis.com/4.6/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;" to just before &amp;lt;/body&amp;gt;. It got rid of the error, but my map still wasn't showing up. I was bringing in the map Javascript from a separate js file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote a custom Drupal module to handle it all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Mar 2018 16:04:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/has-anyone-had-success-integrating-the-javascript/m-p/479446#M44569</guid>
      <dc:creator>StevePeralta</dc:creator>
      <dc:date>2018-03-13T16:04:22Z</dc:date>
    </item>
    <item>
      <title>Re: Has anyone had success integrating the Javascript API (4.6) with Drupal 7x?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/has-anyone-had-success-integrating-the-javascript/m-p/479447#M44570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I will answer my own question after a few days of toiling over this. Drupal 7 is not friendly to the DOM and blasts it from left and right with all kinds of stuff, so the key is to get the Esri&amp;nbsp;scripts and your custom scripts loaded at the same time which, for Drupal, means in the same file. There are other ways of doing this, but not without a lot of Drupal headaches. So!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG&gt;1. Create your Drupal module.&lt;/STRONG&gt; I created a module called "find_my_leg" which is short for "Find My Legislator." Directory/file structure looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;modules/custom/find_my_leg&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/find_my_leg.info&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/find_my_leg.module&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/theme.inc&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/js/findmyleg.js&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/templates&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;modules/custom/find_my_leg/theme/templates/find_my_leg_page.tpl.php&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;2. Write your map code.&lt;/STRONG&gt; The only three files I'll provide code for here are "find_my_leg_page.tpl.php", "findmyleg.js," and "find_my_leg.module." The others are out of the scope of this post. Check Drupal 7 docs for more info.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;-------------------------------&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;STRONG&gt;find_my_leg_page.tpl.php&lt;/STRONG&gt;

&amp;lt;link rel="stylesheet"&amp;nbsp;&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;href="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.6%2Fesri%2Fcss%2Fmain.css" target="_blank"&gt;https://js.arcgis.com/4.6/esri/css/main.css&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;lt;script defer src="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fjs.arcgis.com%2F4.6%2F" target="_blank"&gt;https://js.arcgis.com/4.6/&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;&amp;lt;/script&amp;gt;&lt;/SPAN&gt;
&amp;lt;script defer src="/sites/all/modules/custom/find_my_leg/theme/js/findmyleg.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;!-- Replace these with your own styles --&amp;gt;
&amp;lt;style&amp;gt;

main#main-content.main-content{
width: 100%;
margin-top: -50px;
}

#viewDiv {
 border: 1px solid #ccc;
 padding: 0px;
 margin: 0;
 height: 600px;
 width: 100%;
}

.findLegContainer {
 display: grid;
 grid-template-columns: 60px auto;
 grid-gap: 10px;
 width: 100%;
}

.findLegContainer &amp;gt; div {
 text-align: left;
}

img.headshot {
 width: 100%;
 height: auto;
 margin-bottom: 10px;
}
&amp;lt;/style&amp;gt;
&amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;

&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG&gt;findmyleg.js&lt;/STRONG&gt;


require([
 "esri/Map",
 "esri/views/MapView",
 "esri/layers/FeatureLayer",
 "esri/widgets/Legend",
 "esri/tasks/Locator",
 "esri/widgets/Search",
 "esri/tasks/QueryTask",
 "esri/tasks/support/Query",
 "dojo/domReady!"
 ], function(
 Map, MapView, FeatureLayer, Legend, Locator, Search, QueryTask, Query
 ) {
 
 //REST endpoints
 var senateServiceUrl = "Your REST endpoint for your senate data";
 var houseServiceUrl = "Your REST endpoint for your house data";
 var locatorServiceUrl = "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer";
 
 //Layer fill and lines
 var houseFill = {
 type: "simple-fill", // autocasts as new SimpleFillSymbol()
 style: "none",
 outline: { // autocasts as new SimpleLineSymbol()
 color: [165, 223, 65, 1],
 width: 1
 }
 };
 
 var senateFill = {
 type: "simple-fill", // autocasts as new SimpleFillSymbol()
 style: "none",
 outline: { // autocasts as new SimpleLineSymbol()
 color: [33, 151, 212, 1],
 width: 1
 }
 };
 
 //Renderers
 var houseRenderer = {
 type: "simple", // autocasts as new SimpleRenderer()
 symbol: houseFill
 };
 
 var senateRenderer = {
 type: "simple", // autocasts as new SimpleRenderer()
 symbol: senateFill
 };
 
 
 // Create the PopupTemplates
 var senatePopupTemplate = { // autocasts as new PopupTemplate()
 title: "Senator {FIRST_NAME} {LAST_NAME}",
 content: "&amp;lt;div class='findLegContainer'&amp;gt;&amp;lt;div&amp;gt;&amp;lt;img class='headshot' src='/sites/default/files/{MEMBER_PICTURE}' /&amp;gt;&amp;lt;/div&amp;gt;" +
 "&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;{CHAMBER}enate District {DISTRICT} &amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;" +
 "E-mail: &amp;lt;a href='mailto: {EMAIL}'&amp;gt;{EMAIL}&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;" +
 "Webpage: &amp;lt;a href='https://community.esri.com/node/{WEBSITE}' target='_blank'&amp;gt;{FIRST_NAME} {LAST_NAME}&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;"
 };
 
 var housePopupTemplate = { // autocasts as new PopupTemplate()
 title: "Representative {FIRST_NAME} {LAST_NAME}",
 content: "&amp;lt;div class='findLegContainer'&amp;gt;&amp;lt;div&amp;gt;&amp;lt;img class='headshot' src='/sites/default/files/{MEMBER_PICTURE}' /&amp;gt;&amp;lt;/div&amp;gt;" +
 "&amp;lt;div&amp;gt;&amp;lt;b&amp;gt;{CHAMBER}ouse District {DISTRICT} &amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt;" +
 "E-mail: &amp;lt;a href='mailto: {EMAIL}'&amp;gt;{EMAIL}&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;" +
 "Webpage: &amp;lt;a href='https://community.esri.com/node/{WEBSITE}' target='_blank'&amp;gt;{FIRST_NAME} {LAST_NAME}&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;" 
 };
 
 //Create Feature Layers
 var houseLyr = new FeatureLayer({
 url: houseServiceUrl,
 renderer: houseRenderer,
 popupTemplate: housePopupTemplate,
 legendEnabled: true,
 outFields: ["*"]
 });
 
 var senateLyr = new FeatureLayer({
 url: senateServiceUrl,
 renderer: senateRenderer,
 popupTemplate: senatePopupTemplate,
 outFields: ["*"]
 });
 
 //Instantiate map
 var map = new Map({
 basemap: "streets",
 layers: [houseLyr, senateLyr]
 });
 
 //Instantiate map view
 var view = new MapView({
 container: "viewDiv",
 map: map,
 center: [-105.358887, 39.113014],
 zoom: 7,
 popup: {
 //features: legPopups,
 dockEnabled: false,
 dockOptions: {
 buttonEnabled: false,
 breakpoint: false
 }
 }
 });

//Search widget
 var searchWidget = new Search({ 
 view: view,
 AllPlaceholder: "Rep or Senator Last Name",
 sources: [{
 locator: new Locator({ url: locatorServiceUrl }),
 singleLineFieldName: "SingleLine",
 name: "Place",
 localSearchOptions: {
 minScale: 300000,
 distance: 50000
 },
 placeholder: "Search Geocoder",
 maxResults: 3,
 maxSuggestions: 6,
 suggestionsEnabled: true,
 minSuggestCharacters: 0
 },
 {
 featureLayer: houseLyr,
 searchFields: ["LAST_NAME"],
 displayField: "LAST_NAME",
 exactMatch: false,
 outFields: ["*"],
 name: "House Members",
 maxResults: 10,
 maxSuggestions: 10,
 suggestionsEnabled: true,
 minSuggestCharacters: 0,
 placeholder: "example: Duran"
 },
 {
 featureLayer: senateLyr,
 searchFields: ["LAST_NAME"],
 displayField: "LAST_NAME",
 exactMatch: false,
 outFields: ["*"],
 name: "Senate Members",
 placeholder: "example: Sonnenberg",
 maxResults: 6,
 maxSuggestions: 6,
 suggestionsEnabled: true,
 minSuggestCharacters: 0
 }]
 
 });
 
 
 /*var legend = new Legend({
 view: view,
 layerInfos: [{
 layer: houseLyr,
 title: "House Boundary Color"
 },{
 layer: senateLyr,
 title: "Senate Boundary Color"
 }
 ]
 });

view.ui.add(legend, "bottom-right");*/
 
 
 //Add the search widget
 view.ui.add(searchWidget, {
 position: "top-left",
 index: 0
 });
 
 //Move zoom button to top right
 view.ui.move("zoom", "top-right");

});

&lt;STRONG&gt;find_my_leg.module

&lt;/STRONG&gt;&amp;lt;?php

/*
 * @author Steve Peralta
 */

/*
 * Implements hook_menu().
 */
function find_my_leg_menu() {
 $items['findmylegislator'] = array(
 'title' =&amp;gt; 'Find My Legislator',
 'page callback' =&amp;gt; 'find_my_leg_page',
 'access callback' =&amp;gt; TRUE,
 'type' =&amp;gt; MENU_CALLBACK
 );
 
 
 return $items;
}

/**
 * Implements hook_theme()
 */
function find_my_leg_theme() {
 return array(
 'themekit' =&amp;gt; array(
 'render element' =&amp;gt; 'elements',
 'template' =&amp;gt; 'theme/templates/find_my_leg_page',
 ),
 );
}

/**
 * Page callback for /findmylegislator.
 */
function find_my_leg_page() {
 return theme('themekit');
}

&lt;/PRE&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;And that is it! I'm super new to Esri so there are some things to improve on here, I'm sure, but hope you get some use out of it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:09:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/has-anyone-had-success-integrating-the-javascript/m-p/479447#M44570</guid>
      <dc:creator>StevePeralta</dc:creator>
      <dc:date>2021-12-11T21:09:48Z</dc:date>
    </item>
  </channel>
</rss>

