Country boundaries in ESRI ARCGIS desktop map using javascript

5296
7
02-17-2015 02:40 AM
HemaBahirwani
New Contributor II

Hello,

 

I want to display country boundaries on the arcgis desktop map application, what exactly do we have to use for this?

Tags (1)
0 Kudos
7 Replies
FC_Basson
MVP Regular Contributor

You could use the Esri sample data that is standard with the installation disks or the Esri Web services here: http://server.arcgisonline.com/arcgis/rest/services/Reference

0 Kudos
HemaBahirwani
New Contributor II

Thank you for your reply. While researching, i did come across this web service, since i am new to esri, i don't know how to incorporate this in my code. If you could please guide me on that, it would be really helpful.

FC_Basson
MVP Regular Contributor

You can navigate to a specific web service page e.g. http://server.arcgisonline.com/arcgis/rest/services/Reference/World_Boundaries_and_Places_Alternate/... and at the top of the page there are a couple of "View In" options.  For ArcGIS Desktop you can click on the ArcMap link, which will allow you to download a layer file (*.lyr) for ArcGIS Desktop.

0 Kudos
FC_Basson
MVP Regular Contributor

Are you using Legacy or AMD style class referencing?

You add the World reference layer as a Dynamic Map Service layer to your map. The Javascript API reference is here: https://developers.arcgis.com/javascript/jsapi/arcgisdynamicmapservicelayer.html

The code for the constructor will look like this:

var worldDMS = new esri.ArcGISDynamicMapServiceLayer(""http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer");
map.addLayer(worldDMS);
0 Kudos
HemaBahirwani
New Contributor II

Hello,

I tried the code you gave. i added the following :

dojo.require("esri.layers.agsdynamic");

  require([

    "esri/map", "esri/graphic", "esri/symbols/SimpleMarkerSymbol",

    "esri/tasks/GeometryService", "esri/tasks/ProjectParameters",

    "esri/SpatialReference", "esri/InfoTemplate", "dojo/dom", "dojo/on",

    "dojo/domReady!"

  ], function(

    Map, Graphic, SimpleMarkerSymbol,

    GeometryService, ProjectParameters,

    SpatialReference, InfoTemplate, dom, on

  )

and then the code you gave, but it didn't work.

i am using SAP UI5 and have called  <script src="http://js.arcgis.com/3.12/"></script> for map implementation in eclipse

0 Kudos
FC_Basson
MVP Regular Contributor

Your code snippet would not create the map to add any layer to it, so yes my code will not work in that case.

I think the best would be for you to work through the API reference and samples.  You can start here:  https://developers.arcgis.com/javascript/jshelp/intro_firstmap_amd.html

No need for me to repeat what has been explained in many good samples.

HemaBahirwani
New Contributor II

Thank you so much. it was of great help.

0 Kudos