require([ "esri/map", "esri/arcgis/utils", "dojo/domReady!" ], function(Map, arcgisUtils){ arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) { map = response.map; }); });
map = new Map("mapDiv", { center: [-77.4329, 37.5410], zoom: 6, basemap: "streets"
<script> var map; require(["esri/map", "esri/arcgis/utils", "esri/dijit/Legend", "dojo/domReady!" ], function(Map, arcgisUtils, Legend ) { arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) { map = response.map; var legend = new Legend({ map: map, layerInfos:(arcgisUtils.getLegendLayers(response)) }, "legendDiv"); legend.startup(); }); }); </script>
Solved! Go to Solution.
Yea I tried your example EXACTLY....it works in Fiddle but not when I placed it in my IIS website. Could there be something in IIS thats not letting me get there?
I used the map ID that you did in your Fiddle examples....that should work right? Does not on my side
Am I not getting the correct ID to you? Where exactly do I get it from....after I open it from within ArcGIS online org account? When I try those ids I dont even get to where you are asking for a login
Do I have to have an editable Feature in the web map? It should work with simply the basemap right>
Yes I shared it
[ATTACH=CONFIG]30619[/ATTACH]
Do you have an ID that works that I can test in my html code?
I have not idea whats going on....
This is my Whole page....all the code I am using<!DOCTYPE html> <html> <head> <title>Create a Web Map</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <link rel="stylesheet" type="text/css" href="http://js.arcgis.com/3.8/js/esri/css/esri.css"> <style> html,body,#mapDiv,.map.container{ padding:0; margin:0; height:100%; } </style> <script>var dojoConfig = { parseOnLoad:true };</script> <script src="http://js.arcgis.com/3.8compact/"></script> <script> require([ "esri/map", "esri/arcgis/utils", "dojo/domReady!" ], function(Map, arcgisUtils){ arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) { map = response.map; }); }); </script> </head> <body> <div id="mapDiv"></div> </body> </html>
http://www.arcgis.com/sharing/rest/%E2%80%A67f843bb0a37849f68a5a2cc3d2b06288?f=json
{"error":{"code":400,"messageCode":"GWM_0002","message":"Invalid URL","details":[]}}
<script> var map; require(["esri/map", "dojo/domReady!" ], function(Map) { map = new Map("mapDiv", { center: [-77.4329, 37.5410], zoom: 6, basemap: "streets" }); }); </script>
<script> require([ "esri/map", "esri/arcgis/utils", "dojo/domReady!" ], function(Map, arcgisUtils){ arcgisUtils.createMap("1a40fa5cc1ab4569b79f45444d728067", "mapDiv").then(function (response) { map = response.map; }); }); </script>
www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json
I don't know why the url gets truncated on my latest post but the correct one is:www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json
Can you access successfully?
<script> require([ "esri/map", "esri/arcgis/utils", "dojo/domReady!" ], function(Map, arcgisUtils){ arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) { map = response.map; }); }); </script>
i can get to it from your URL but when I run from here.....as seen below code....I get this in the console error on WebMap
It has to be something with IIS....maybe the IIS that comes with Win8 is not able to get out or wont get to that URL???
I am lost here...
Tried the Geocoder example from API examples and it just spins endlessly when I submit an address.
I get this error with the Geocoder Example
ERROR Geocoder example https://developers.arcgis.com/en/javascript/jssamples/locator_simple.html
MLHttpRequest cannot load http://services.arcgisonline.com/ArcGIS/rest/info?f=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
ERROR FOR WebMap:
OPTIONS file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json init.js:158
r {stack: "Error: Unable to load file://www.arcgis.com/sharin???uest.h (http://js.arcgis.com/3.8/init.js:160:167)", message: "Unable to load file://www.arcgis.com/sharing/rest/???7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0", response: Object, status: 0, responseText: ""???}
_ssl: undefined
log: undefined
message: "Unable to load file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0"
response: Object
responseText: ""
stack: "Error: Unable to load file://www.arcgis.com/sharing/rest/content/items/7f843bb0a37849f68a5a2cc3d2b06288?f=json status: 0??? at Error (native)??? at new r (http://js.arcgis.com/3.8/init.js:221:367)??? at XMLHttpRequest.h (http://js.arcgis.com/3.8/init.js:160:167)"
status: 0
xhr: XMLHttpRequest
__proto__: a<script> require([ "esri/map", "esri/arcgis/utils", "dojo/domReady!" ], function(Map, arcgisUtils){ arcgisUtils.createMap("7f843bb0a37849f68a5a2cc3d2b06288", "mapDiv").then(function (response) { map = response.map; }); }); </script>
localhost/test/forum/test.html
http://jontest.test.com/test/forum/test.html
file:///C:/inetpub/wwwroot/test/forum/test.html