Select to view content in your preferred language

Getting started. Newbie questions.

1079
4
Jump to solution
05-19-2014 09:51 PM
DanielKim2
Deactivated User
Hi all,

I am new to ArcGIS and I am trying to use API for JavaScript.
I have converted .dwg file to shapefile and have published it onto my local webserver.

Basically, the map contains very small area with only few blocks which is not developed yet(so google map does not have it).
And I want to make every block clickable and want to view Unit number or Lot number and stuff(little more details).

So I found ArcGIS from google and followed tutorial (Use an ArcGIS.com webmap)
https://developers.arcgis.com/javascript/jstutorials/intro_agstemplate_amd.html

However, I am having difficulties with unique map identifier.
This is my URL and I don't have webmap ID (html?webmap=?).

http://www.arcgis.com/home/webmap/viewer.html?url=http%3A%2F%2Flocalhost%3A6080%2Farcgis%2Frest%2Fse...

I tried to put "http%3A%2F%2Flocalhost%3A6080%2Farcgis%2Frest%2Fservices%2FMyMapService444%2FMapServer&source=sd
". But it shows blank page without any error message. Guess I am not really understanding how ArcGIS works?

Could anyone please help me out?
Thank heaps in advance.
0 Kudos
1 Solution

Accepted Solutions
TimWitt
Deactivated User
Daniel,

make sure you set your permissions of your map to share with everybody. On the upper right of your map click on "Share" and then check "Everyone (Public)". This should make it work.

Tim

View solution in original post

0 Kudos
4 Replies
TimWitt
Deactivated User
Daniel,

to be able to host a shapefile/feature service, you would need ArcGIS Server.

You can however zip your shapefile and add it to a webmap.

Sign into your arcgis online account, go here http://www.arcgis.com/home/webmap/viewer.html?useExisting=1 , on the top left click on Add -> Add layer from File and navigate to your zipped shapefile.

Now save your map, this will produce the numbers you need in your navigation bar.

Hope this helps!

Tim
0 Kudos
DanielKim2
Deactivated User
Daniel,

to be able to host a shapefile/feature service, you would need ArcGIS Server.

You can however zip your shapefile and add it to a webmap.

Sign into your arcgis online account, go here http://www.arcgis.com/home/webmap/viewer.html?useExisting=1 , on the top left click on Add -> Add layer from File and navigate to your zipped shapefile.

Now save your map, this will produce the numbers you need in your navigation bar.

Hope this helps!

Tim


Thank you Tim.
I have webmap ID now but when I put it into java script, it shows only blank pages.

There is my URL and the javascript code. Am I missing something or have I done something wrong?


http://www.arcgis.com/home/webmap/viewer.html?webmap=bfccf435f7584e16a57d4674103e374a

<!DOCTYPE html>
  <html>
  <head>
  <title>Create a Web Map</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no">

  <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.9/js/esri/css/esri.css">
  <style>
    html,body,#mapDiv,.map.container{
      padding:0;
      margin:0;
      height:100%;
    }
    #legendDiv{
      background-color: #fff;
      position: absolute !important;
      z-index: 99;
      top:10px;
      right:20px;
    }
  </style>

  <script>var dojoConfig = { parseOnLoad:true };</script>
  <script src="http://js.arcgis.com/3.9compact/"></script>
  <script>
    var map,
        webmapId = "bfccf435f7584e16a57d4674103e374a";
   
    require([
      "esri/map",
      "esri/arcgis/utils",
      "esri/dijit/Legend",
      "dojo/domReady!"
      ], function (Map, arcgisUtils, Legend) {
        arcgisUtils.createMap(webmapId, "mapDiv").then(function (response) {
        map = response.map    

        var legend = new Legend({
            map: map,
            layerInfos:(arcgisUtils.getLegendLayers(response))
        }, "legendDiv");
       
        legend.startup();
    });
    });
  </script>

  </head>

  <body>
    <div id="mapDiv"></div>
    <div id="legendDiv"></div>
  </body>
  </html>
0 Kudos
TimWitt
Deactivated User
Daniel,

make sure you set your permissions of your map to share with everybody. On the upper right of your map click on "Share" and then check "Everyone (Public)". This should make it work.

Tim
0 Kudos
DanielKim2
Deactivated User
Daniel,

make sure you set your permissions of your map to share with everybody. On the upper right of your map click on "Share" and then check "Everyone (Public)". This should make it work.

Tim



Thanks so much Tim. I really appreciate it.
0 Kudos