Loading a File geodatabase on the Server

1593
0
06-14-2016 12:22 PM
PennySawyer1
New Contributor

I am trying to learn how to write scripts with Javascript. I have this book named " Building Web Applications with ArcGIS." They provided the data and the sources is file geodatabases. I have the data stored onto our network drive. I can publish the mxd with the file gdb on to our server. However, i can not set the capibilities as feature access  when I go to share the map through ArcGIS Online as a web service. I have tested the script which works but I am unable to  see any layers when i run the script through chrome.

Is it possible to save the files as shapefile and publish to the server and then host theough ArcGIS Online. Below i have added a  code  the Author of this book has provided and how to add a map from the server into a javascript.

I asked people from Packt and they could not help.

<html>

<head>

<title>Bestaurants Web Application</title>

<link rel="stylesheet" href="arcgisjs/esri.css">

<script src="arcgisjs/3.10/init.js"></script>

<script>

dojo.require("esri.map");

function startup()

{

  //alert("map is about to load");

  //create the map object and load it into the 'mymap' div element

  var map = new esri.Map("mymap");

  //load the layer into an object

  var lyr = new esri.layers.ArcGISDynamicMapServiceLayer

  (

  "http://arcgismachine:6080/arcgis/rest/services/Bestaurants/MapServer"

  );

   

  //add the layer to map

  map.addLayer(lyr);

}

dojo.addOnLoad(startup);

</script>

</head>

<body>

<table border =1 width = '1000px' height = '700px' align =center>

<tr>

<td colspan =2 width='100%' height ='10%'>

  <!-- The toolbar where we will place tools -->

  The toolbar that contains useful tools to interact with the map and search for restaurants  <b> (100% width and 10% height) </b>

</td>

</tr>

<tr>

<td width='20%' height ='40%'>

  <!-- The legend of the map goes here -->

  The legend items go here <br> <b>(20% width and 40% height) </b>

</td>

<td width='80%' height ='85%' rowspan =2 valign = top>

  <div id='mymap' class='arcgismap' >

  </div>

</td>

</tr>

<tr>

<td width='20%' height ='40%'>

   <!-- The search results will go here -->

   The search results goes here, we will display the search for the users in this box <br> <b>(20% width and 40% height)</b>

</td>

</tr>

<tr>

  <td colspan =2 width='100%' height ='5%'>

  <!-- The status bar for displaying messages goes here -->

  The status bar goes here  <b> (100% width and 5% height)</b>

  </td>

</tr>

</table>

</body>

</html>

0 Kudos
0 Replies