<?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: How to Add Map Service to API Javascript in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042709#M72318</link>
    <description>&lt;P&gt;Thank you for the information. I made the modification and then it errored out on something else. So I started from beginning modifying the original esri sample code which I attached initially. (Sorry, I'm new to this and I don't see an option to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;use the "Insert/Edit code sample" button so I'm pasting&amp;nbsp;it here.)&amp;nbsp; The basemap is good but the annexation map service is not displaying. Any suggestion is appreciated. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;map = new Map("mapDiv", {&lt;BR /&gt;// basemap: "streets",&lt;BR /&gt;center: [-85.82966, 33.666494],&lt;BR /&gt;zoom: 7&lt;BR /&gt;});&lt;BR /&gt;var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("&lt;A href="https://gismaps.fultoncountyga.gov/arcgispub2/rest/services/Basemap/FultonStreetBaseMap/MapServer" target="_blank" rel="noopener"&gt;https://gismaps/arcgis/rest/services/Basemap/StreetBaseMap/MapServer&lt;/A&gt;");&lt;BR /&gt;map.addLayer(baseMapLayer);&lt;/P&gt;&lt;P&gt;map.on("load", initToolbar);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var featureLayer1 = new FeatureLayer("https://gismaps/arcgis/rest/services/CountyServices/Annexations/MapServer/0", {&lt;BR /&gt;mode: FeatureLayer.MODE_SELECTION,&lt;BR /&gt;infoTemplate: new InfoTemplate("Case Name: ${CaseName}", "${*}"),&lt;BR /&gt;outFields: ["NumParcels"]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;map.addLayers([featureLayer1, featureLayer2, featureLayer3]);&lt;/P&gt;</description>
    <pubDate>Thu, 01 Apr 2021 01:17:21 GMT</pubDate>
    <dc:creator>Orange11</dc:creator>
    <dc:date>2021-04-01T01:17:21Z</dc:date>
    <item>
      <title>How to Add Map Service to API Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042497#M72310</link>
      <description>&lt;P&gt;Hi, I have an esri sample code attached -- I successfully inserted my basemap but when I tried to add my mapservice, it doesn't error out but it doesn't show the mapservice. Any suggestions on what I'm missing in the code?&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 17:52:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042497#M72310</guid>
      <dc:creator>Orange11</dc:creator>
      <dc:date>2021-03-31T17:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add Map Service to API Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042514#M72311</link>
      <description>&lt;P&gt;When adding code, use the "Insert/Edit code sample" button instead of adding it as an attachment.&lt;/P&gt;&lt;P&gt;The first thing I see is that the require modules don't match up with the function arguments&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;require(["esri/map", "esri/toolbars/draw", "dojo/promise/all",
    "esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol",
    "esri/symbols/PictureFillSymbol", "esri/symbols/CartographicLineSymbol", "esri/layers/FeatureLayer",
    "esri/graphic", "esri/tasks/query", "esri/tasks/QueryTask", "esri/InfoTemplate",
    "esri/Color", "dojo/dom", "dojo/on", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane",
    "dijit/layout/AccordionContainer", "dojo/domReady!"], function (
Map, Draw, All,
SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol,
PictureFillSymbol, CartographicLineSymbol, FeatureLayer,
Graphic, Query, QueryTask, InfoTemplate,
Color, dom, on, parser, ArcGISDynamicMapServiceLayer) {&lt;/LI-CODE&gt;&lt;P&gt;You haven't included the module for ArcGISDynamicMapServiceLayer.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 18:34:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042514#M72311</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-03-31T18:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add Map Service to API Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042697#M72317</link>
      <description>&lt;P&gt;Ken, thank you for the information. I made the modification fine but it's erroring out on something else so I started from beginning.&amp;nbsp; (Sorry, I'm new to this and I don't see an option to&amp;nbsp;&lt;SPAN&gt;use the "Insert/Edit code sample" button so I will paste it here.)&amp;nbsp; This is the original esri sample code and I added my basemap fine. But when I add my annexation map service, it doesn't display. Thank you for any suggestions you can provide.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;==========================================&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;var map, tb;&lt;/P&gt;&lt;P&gt;require([&lt;BR /&gt;"esri/map", "esri/toolbars/draw", "dojo/promise/all",&lt;BR /&gt;"esri/symbols/SimpleMarkerSymbol", "esri/symbols/SimpleLineSymbol", "esri/symbols/SimpleFillSymbol",&lt;BR /&gt;"esri/symbols/PictureFillSymbol", "esri/symbols/CartographicLineSymbol", "esri/layers/FeatureLayer",&lt;BR /&gt;"esri/graphic", "esri/tasks/query", "esri/tasks/QueryTask", "esri/InfoTemplate",&lt;BR /&gt;"esri/Color", "dojo/dom", "dojo/on", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane",&lt;BR /&gt;"dijit/layout/AccordionContainer", "dojo/domReady!"], function (&lt;BR /&gt;Map, Draw, All,&lt;BR /&gt;SimpleMarkerSymbol, SimpleLineSymbol, SimpleFillSymbol,&lt;BR /&gt;PictureFillSymbol, CartographicLineSymbol, FeatureLayer,&lt;BR /&gt;Graphic, Query, QueryTask, InfoTemplate,&lt;BR /&gt;Color, dom, on, parser) {&lt;/P&gt;&lt;P&gt;parser.parse();&lt;/P&gt;&lt;P&gt;map = new Map("mapDiv", {&lt;BR /&gt;// basemap: "streets",&lt;BR /&gt;center: [-85.82966, 33.666494],&lt;BR /&gt;zoom: 7&lt;BR /&gt;});&lt;BR /&gt;var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("&lt;A href="https://gismaps.fultoncountyga.gov/arcgispub2/rest/services/Basemap/FultonStreetBaseMap/MapServer" target="_blank"&gt;https://gismaps.fultoncountyga.gov/arcgispub2/rest/services/Basemap/FultonStreetBaseMap/MapServer&lt;/A&gt;");&lt;BR /&gt;map.addLayer(baseMapLayer);&lt;/P&gt;&lt;P&gt;map.on("load", initToolbar);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var featureLayer1 = new FeatureLayer("&lt;A href="https://gismaps.fultoncountyga.gov/arcgispub/rest/services/CountyServices/Annexations/MapServer/0" target="_blank"&gt;https://gismaps.fultoncountyga.gov/arcgispub/rest/services/CountyServices/Annexations/MapServer/0&lt;/A&gt;", {&lt;BR /&gt;mode: FeatureLayer.MODE_SELECTION,&lt;BR /&gt;infoTemplate: new InfoTemplate("Case Name: ${CaseName}", "${*}"),&lt;BR /&gt;outFields: ["NumParcels"]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;// var featureLayer1 = new FeatureLayer("&lt;A href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0&lt;/A&gt;", {&lt;BR /&gt;// mode: FeatureLayer.MODE_SELECTION,&lt;BR /&gt;// infoTemplate: new InfoTemplate("Block: ${BLOCK}", "${*}"),&lt;BR /&gt;// outFields: ["POP2000", "HOUSEHOLDS", "HSE_UNITS", "TRACT", "BLOCK"]&lt;BR /&gt;// });&lt;/P&gt;&lt;P&gt;var featureLayer2 = new FeatureLayer("&lt;A href="https://gismaps.fultoncountyga.gov/arcgispub/rest/services/Temp/ParcelDownload_test/FeatureServer" target="_blank"&gt;https://gismaps.fultoncountyga.gov/arcgispub/rest/services/Temp/ParcelDownload_test/FeatureServer&lt;/A&gt;", {&lt;BR /&gt;mode: FeatureLayer.MODE_SELECTION,&lt;BR /&gt;infoTemplate: new InfoTemplate("Block Group: ${BLKGRP}", "${*}"),&lt;BR /&gt;outFields: ["POP2000", "HOUSEHOLDS", "HSE_UNITS", "TRACT", "BLKGRP"]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;var featureLayer3 = new FeatureLayer("&lt;A href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2&lt;/A&gt;", {&lt;BR /&gt;mode: FeatureLayer.MODE_SELECTION,&lt;BR /&gt;infoTemplate: new InfoTemplate("County Name: ${NAME}", "${*}"),&lt;BR /&gt;outFields: ["POP2000", "HOUSEHOLDS", "HSE_UNITS", "NAME"]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;map.addLayers([featureLayer1, featureLayer2, featureLayer3]);&lt;/P&gt;&lt;P&gt;// markerSymbol is used for point and multipoint, see &lt;A href="http://raphaeljs.com/icons/#talkq" target="_blank"&gt;http://raphaeljs.com/icons/#talkq&lt;/A&gt; for more examples&lt;BR /&gt;var markerSymbol = new SimpleMarkerSymbol();&lt;BR /&gt;markerSymbol.setPath("M16,4.938c-7.732,0-14,4.701-14,10.5c0,1.981,0.741,3.833,2.016,5.414L2,25.272l5.613-1.44c2.339,1.316,5.237,2.106,8.387,2.106c7.732,0,14-4.701,14-10.5S23.732,4.938,16,4.938zM16.868,21.375h-1.969v-1.889h1.969V21.375zM16.772,18.094h-1.777l-0.176-8.083h2.113L16.772,18.094z");&lt;BR /&gt;markerSymbol.setColor(new Color("#00FFFF"));&lt;/P&gt;&lt;P&gt;// lineSymbol used for freehand polyline, polyline and line.&lt;BR /&gt;var lineSymbol = new CartographicLineSymbol(&lt;BR /&gt;CartographicLineSymbol.STYLE_SOLID,&lt;BR /&gt;new Color([255, 0, 0]), 10,&lt;BR /&gt;CartographicLineSymbol.CAP_ROUND,&lt;BR /&gt;CartographicLineSymbol.JOIN_MITER, 5);&lt;/P&gt;&lt;P&gt;// fill symbol used for extent, polygon and freehand polygon&lt;BR /&gt;var fillSymbol = new SimpleFillSymbol();&lt;/P&gt;&lt;P&gt;function initToolbar() {&lt;BR /&gt;tb = new Draw(map);&lt;BR /&gt;tb.on("draw-end", addGraphic);&lt;/P&gt;&lt;P&gt;// event delegation so a click handler is not&lt;BR /&gt;// needed for each individual button&lt;BR /&gt;on(dom.byId("info"), "click", function (evt) {&lt;BR /&gt;if (evt.target.id === "info") {&lt;BR /&gt;return;&lt;BR /&gt;}&lt;BR /&gt;var tool = evt.target.id.toLowerCase();&lt;BR /&gt;map.disableMapNavigation();&lt;BR /&gt;tb.activate(tool);&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function addGraphic(evt) {&lt;BR /&gt;//deactivate the toolbar and clear existing graphics&lt;BR /&gt;tb.deactivate();&lt;BR /&gt;map.enableMapNavigation();&lt;/P&gt;&lt;P&gt;// figure out which symbol to use&lt;BR /&gt;var symbol;&lt;BR /&gt;if (evt.geometry.type === "point" || evt.geometry.type === "multipoint") {&lt;BR /&gt;symbol = markerSymbol;&lt;BR /&gt;} else if (evt.geometry.type === "line" || evt.geometry.type === "polyline") {&lt;BR /&gt;symbol = lineSymbol;&lt;BR /&gt;} else {&lt;BR /&gt;symbol = fillSymbol;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;map.graphics.add(new Graphic(evt.geometry, symbol));&lt;BR /&gt;queryMapService(evt.geometry);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function queryMapService(Geom) {&lt;BR /&gt;var promises = [];&lt;/P&gt;&lt;P&gt;var query = new Query();&lt;BR /&gt;query.returnGeometry = false;&lt;BR /&gt;query.outFields = ["*"];&lt;BR /&gt;query.geometry = Geom;&lt;BR /&gt;promises.push(featureLayer1.selectFeatures(query, FeatureLayer.SELECTION_NEW));&lt;BR /&gt;promises.push(featureLayer2.selectFeatures(query, FeatureLayer.SELECTION_NEW));&lt;BR /&gt;promises.push(featureLayer3.selectFeatures(query, FeatureLayer.SELECTION_NEW));&lt;BR /&gt;var allPromises = new All(promises);&lt;BR /&gt;allPromises.then(function (r) {&lt;BR /&gt;showResults(r);&lt;BR /&gt;});&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function showResults(results) {&lt;BR /&gt;var resultCount = results.length;&lt;BR /&gt;console.log(resultCount);&lt;BR /&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;================================&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 00:05:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042697#M72317</guid>
      <dc:creator>Orange11</dc:creator>
      <dc:date>2021-04-01T00:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add Map Service to API Javascript</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042709#M72318</link>
      <description>&lt;P&gt;Thank you for the information. I made the modification and then it errored out on something else. So I started from beginning modifying the original esri sample code which I attached initially. (Sorry, I'm new to this and I don't see an option to&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;use the "Insert/Edit code sample" button so I'm pasting&amp;nbsp;it here.)&amp;nbsp; The basemap is good but the annexation map service is not displaying. Any suggestion is appreciated. Thank you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;map = new Map("mapDiv", {&lt;BR /&gt;// basemap: "streets",&lt;BR /&gt;center: [-85.82966, 33.666494],&lt;BR /&gt;zoom: 7&lt;BR /&gt;});&lt;BR /&gt;var baseMapLayer = new esri.layers.ArcGISTiledMapServiceLayer("&lt;A href="https://gismaps.fultoncountyga.gov/arcgispub2/rest/services/Basemap/FultonStreetBaseMap/MapServer" target="_blank" rel="noopener"&gt;https://gismaps/arcgis/rest/services/Basemap/StreetBaseMap/MapServer&lt;/A&gt;");&lt;BR /&gt;map.addLayer(baseMapLayer);&lt;/P&gt;&lt;P&gt;map.on("load", initToolbar);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;var featureLayer1 = new FeatureLayer("https://gismaps/arcgis/rest/services/CountyServices/Annexations/MapServer/0", {&lt;BR /&gt;mode: FeatureLayer.MODE_SELECTION,&lt;BR /&gt;infoTemplate: new InfoTemplate("Case Name: ${CaseName}", "${*}"),&lt;BR /&gt;outFields: ["NumParcels"]&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;map.addLayers([featureLayer1, featureLayer2, featureLayer3]);&lt;/P&gt;</description>
      <pubDate>Thu, 01 Apr 2021 01:17:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-map-service-to-api-javascript/m-p/1042709#M72318</guid>
      <dc:creator>Orange11</dc:creator>
      <dc:date>2021-04-01T01:17:21Z</dc:date>
    </item>
  </channel>
</rss>

