Created map and selection detection.