Removes small redundancy

Several variables were defined in the global space, and one `_mapCanvas` was queried twice. This commit removes the redundancy.