Solved! Go to Solution.
Thanks for the reply, Kelly.
I copied your code to an updated fiddle and I still get the same error. I also made a page on my dev machine just to make sure that jsfiddle isn't the problem
http://jsfiddle.net/efx8L/3/
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=7,IE=9"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no"> <title>Dynamic Map Service Layer with Custom Projection and Extent</title> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/dojo/dijit/themes/claro/claro.css"> <link rel="stylesheet" href="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/js/esri/css/esri.css"> <script src="http://serverapi.arcgisonline.com/jsapi/arcgis/3.3/"></script> <script> dojo.require("esri.map"); dojo.require("esri.dijit.Measurement"); function init() { esri.config.defaults.geometryService = new esri.tasks.GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"); var customExtentAndSR = new esri.geometry.Extent(-20037506,-9823074,20037506,10214431,new esri.SpatialReference({"wkid":54052})); //create map with new custom spatial reference and extent. The map will be in the Goode Homolosine Land projection var map = new esri.Map("map", { extent: customExtentAndSR }); dojo.connect(map, "onLoad", function(){ var measurement = new esri.dijit.Measurement({ map: map }, dojo.byId('measurementDiv')); measurement.startup(); }); //map service layer has a default spatial reference of 4326. var mapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Population_World/MapServer"); map.addLayer(mapServiceLayer); } dojo.ready(init); </script> </head> <body class="tundra"> <div id="map" class="claro" style="position:relative; width:1024px; height:512px; border:2px solid #000;background-color:#99CCFF;"></div> <div id="measurementDiv"></div> </body> </html>
Thanks for the reply, Kelly.
I copied your code to an updated fiddle and I still get the same error. I also made a page on my dev machine just to make sure that jsfiddle isn't the problem
http://jsfiddle.net/efx8L/3/