Unable to Create Map from AGOL item

870
4
Jump to solution
08-12-2013 07:53 AM
TiagoRibeiro
Occasional Contributor
Hi Guys,
Can anyone help me understand why my code works for this item which is in the samples "4778fee6371d4e83a22786029f30c7e1", but when I add my own it throws this error ""Provide a geometry service to open Web Map."
Here's the code:
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head>     <title>Create map from AGOL</title>     <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/dojo/dijit/themes/claro/claro.css">     <link rel="stylesheet" href="http://js.arcgis.com/3.6/js/esri/css/esri.css"> </head> <body>     <div style="width: 100%; height: 300px; border: 1px solid black" id="map"></div>     <script src="http://js.arcgis.com/3.6/"></script>     <script>         require([             "esri/arcgis/utils"             , "dojo/ready"             , "dojo/domReady!"         ],         function (arcgisUtils, ready) {             ready(function () {                 arcgisUtils.createMap("a09c3609e11c474e990e8a2dce2e7330", "map").then(function (response) {                     console.log(arguments);                 }, function () {                     console.log(arguments);                 });             });         });     </script> </body>         </html>


The web map and all services are public. If someone could help me figuring out what's going on I'd be much appreciated!

Cheers,

Tiago
0 Kudos
1 Solution

Accepted Solutions
JeffJacobson
Occasional Contributor III
You might also try specifying a geometryServiceURL when calling the createMap function.

View solution in original post

0 Kudos
4 Replies
JeffJacobson
Occasional Contributor III
I looked at your webmap and noticed that the spatial reference being used by all layers including the basemap is 2157 instead of the standard 3857.

The first thing I would try would be to change the basemap in your webmap to use one Esri's basemaps instead of your custom one.
0 Kudos
TiagoRibeiro
Occasional Contributor
I looked at your webmap and noticed that the spatial reference being used by all layers including the basemap is 2157 instead of the standard 3857.

The first thing I would try would be to change the basemap in your webmap to use one Esri's basemaps instead of your custom one.


Thanks for your reply Jeff.
That spatial ref and basemap are actually a requirement for the application from the which the web map will be based on...
But I'll try to add an Esri Basemap to see if the error goes away.
0 Kudos
JeffJacobson
Occasional Contributor III
You might also try specifying a geometryServiceURL when calling the createMap function.
0 Kudos
TiagoRibeiro
Occasional Contributor
You might also try specifying a geometryServiceURL when calling the createMap function.


Thanks for the tip Jeff, that did the trick!
But the question remains. Why do I need to specify a geometry service for this particular web map? Is it because none of the layers is in WGS84? That, IMHO, doesn't make much sense...
0 Kudos