map or mapDiv

858
2
Jump to solution
05-01-2014 02:26 PM
DustinHolt
Occasional Contributor
I'm new to API for JS and I have one question about why we use just "map" on some and "mapDiv" on others?
0 Kudos
1 Solution

Accepted Solutions
Noah-Sager
Esri Regular Contributor
Hi Dustin,

"map" and "mapDiv" are conventions we use to work with the map object. You are free to use either, as long as you are consistent. "mapDiv" may be a bit better to use because it differentiates itself from the actual map object, which you see in the map constructor.

In the screenshot you attached, "mapDiv" refers to the div element which hold the map object. This can be resized or otherwise modified. The "map" in the screenshot is an actual Map object, with an ID of "mapDiv".

For more information:
JavaScript Class: Map

Hope this helps!

-Noah

View solution in original post

0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor
Hi Dustin,

"map" and "mapDiv" are conventions we use to work with the map object. You are free to use either, as long as you are consistent. "mapDiv" may be a bit better to use because it differentiates itself from the actual map object, which you see in the map constructor.

In the screenshot you attached, "mapDiv" refers to the div element which hold the map object. This can be resized or otherwise modified. The "map" in the screenshot is an actual Map object, with an ID of "mapDiv".

For more information:
JavaScript Class: Map

Hope this helps!

-Noah
0 Kudos
DustinHolt
Occasional Contributor
Thanks Noah, I appreciate it.
0 Kudos