Select to view content in your preferred language

Graphics without a base map

3812
10
Jump to solution
08-24-2012 02:34 AM
VladimirElistratov
Occasional Contributor
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
0 Kudos
10 Replies
JeffPace
MVP Alum
excellent derek thanks for the answer and links

vvoovv if you feel like derek (Swingley) answered your question, please click the little check mark on the right side of his post to mark it as "answered"
0 Kudos