Solved! Go to Solution.
I am unable to use graphics without a base map.
It's written in the doc for Map.onLoad:
Fires when the first or base layer has been successfully added to the map.
So I do the following:
dojo.connect(map,"onLoad", init);
var graphics = new esri.layers.GraphicsLayer();
map.addLayer(graphics);
But I'm getting an error after map.addLayer(graphics):
Uncaught TypeError: Cannot read property '_surface' of null
How can I use graphics without a base map?
Thanks,
Vladimir
How about adding a dummy non-graphics layer?.
How to add a dummy non-graphics layer?
jeff.pace:
It looks like the spatial reference of the map is set to the spatial reference of the map's extent.
I checked this in the debugger