We don’t get a lot of help with the actual setting of this poem. In fact, the only place we hear much about is "a little promontory." Thanks a bunch, Walt – that makes everything clear. But, maybe because he doesn’t give us much help with the setting, this allows us to imagine a new setting which would fit the mood of this poem. So, bear with us here, because we think this poem could easily take place in the middle of outer space. Seriously.
In the first half of the poem, he tells us about the spider and the "vacant vast surrounding" (line 3). In the second half, he imagines his soul surrounded by the "measureless oceans of space" (line 7). So, just think of that spider marooned on an asteroid, trying desperately to reach out and grab something. Then, think of Whitman stuffed into a space suit (beard and all) and cartwheeling through empty space, trying to grab onto something. Then, all of a sudden, a huge alien octopus… sorry, we’ll try not to nerd out here. The bottom line is: we think this poem is as much about isolation, empty spaces, and the absence of a setting, as it is about being in a particular place or time.