<?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 non-ESRI data to map with JavaScript API?? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45263#M3941</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To give a simplified but more constructive answer, you'd have some server side code that reads from the database and outputs JSON:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
[ {x: 123456, y:123456, attribute1: "blah"}, ... ]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then load it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var params = {param1: "foo"};//params needed by the serverside file
$.get('load-data.php', params, function(data) {
&amp;nbsp; var graphic;
&amp;nbsp; $.each(data, function(key, val) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic = new esri.Graphic(new esri.geometry.Point(val.x, val.y, map.extent.spatialReference), yourSymbol, {"attribute1": val.attribute1}, yourInfoTemplate);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
}
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Not tested, HTH.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Dec 2021 21:45:29 GMT</pubDate>
    <dc:creator>JamesBurton</dc:creator>
    <dc:date>2021-12-10T21:45:29Z</dc:date>
    <item>
      <title>How to add non-ESRI data to map with JavaScript API??</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45260#M3938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I manage some ArcGIS servers and I publish several map services (&lt;/SPAN&gt;&lt;A href="http://geonb.snb.ca/arcgis/rest/services/"&gt;http://geonb.snb.ca/arcgis/rest/services/&lt;/A&gt;&lt;SPAN&gt;).&amp;nbsp; I have a user that wants to embed my map services into their website.&amp;nbsp; The user has a simple point dataset.&amp;nbsp; The user wants to display their point data on top of my map services.&amp;nbsp; I don't want to add the user's point data to my ArcGIS server.&amp;nbsp; I want the user to keep their data on their own web server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;How can the user add their point data to the map if it is NOT on ArcGIS server?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;What format should they store the data (KML? Shape?)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;What JavaScript function should be used to read the data and add it to the map?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Are there any examples on the web?&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bernie.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Mar 2011 01:16:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45260#M3938</guid>
      <dc:creator>BernieConnors</dc:creator>
      <dc:date>2011-03-19T01:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add non-ESRI data to map with JavaScript API??</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45261#M3939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I manage some ArcGIS servers and I publish several map services (&lt;A href="http://geonb.snb.ca/arcgis/rest/services/"&gt;http://geonb.snb.ca/arcgis/rest/services/&lt;/A&gt;).&amp;nbsp; I have a user that wants to embed my map services into their website.&amp;nbsp; The user has a simple point dataset.&amp;nbsp; The user wants to display their point data on top of my map services.&amp;nbsp; I don't want to add the user's point data to my ArcGIS server.&amp;nbsp; I want the user to keep their data on their own web server.&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;How can the user add their point data to the map if it is NOT on ArcGIS server?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;What format should they store the data (KML? Shape?)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;What JavaScript function should be used to read the data and add it to the map?&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Are there any examples on the web?&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Bernie.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You need to read the data and create an esri.geometry.Point object for each record, then create a Graphics object for each point and draw it on the graphics layer. For this purpose, you want the data to be available in a format which is easily read in Javascript, e.g. JSON or XML.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Mar 2011 07:08:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45261#M3939</guid>
      <dc:creator>JamesBurton</dc:creator>
      <dc:date>2011-03-19T07:08:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add non-ESRI data to map with JavaScript API??</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45262#M3940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Look at some of the samples here: &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Look at the "File Access With Drag and Drop" under the Experimental category.&amp;nbsp; Also look at the samples under the Data Access category.&amp;nbsp; Another good place to look might be the dojo csvstore here: &lt;/SPAN&gt;&lt;A href="http://arcscripts.esri.com/details.asp?dbid=16544"&gt;http://arcscripts.esri.com/details.asp?dbid=16544&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ken&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Mar 2011 16:54:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45262#M3940</guid>
      <dc:creator>KenMorefield</dc:creator>
      <dc:date>2011-03-21T16:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to add non-ESRI data to map with JavaScript API??</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45263#M3941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To give a simplified but more constructive answer, you'd have some server side code that reads from the database and outputs JSON:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
[ {x: 123456, y:123456, attribute1: "blah"}, ... ]&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then load it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var params = {param1: "foo"};//params needed by the serverside file
$.get('load-data.php', params, function(data) {
&amp;nbsp; var graphic;
&amp;nbsp; $.each(data, function(key, val) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic = new esri.Graphic(new esri.geometry.Point(val.x, val.y, map.extent.spatialReference), yourSymbol, {"attribute1": val.attribute1}, yourInfoTemplate);
&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);
}
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Not tested, HTH.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:45:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-non-esri-data-to-map-with-javascript/m-p/45263#M3941</guid>
      <dc:creator>JamesBurton</dc:creator>
      <dc:date>2021-12-10T21:45:29Z</dc:date>
    </item>
  </channel>
</rss>

