     }
 
     private class func allowedCharacterSet() -> NSMutableCharacterSet {
-        let characterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as NSMutableCharacterSet
+        let characterSet = NSCharacterSet.URLQueryAllowedCharacterSet().mutableCopy() as! NSMutableCharacterSet
         characterSet.removeCharactersInString("/")
         return characterSet
     }

        assert(size.width  <= 640 * (retina ? 1 : 2), "maximum width is 1280px (640px for retina)")
        assert(size.height <= 640 * (retina ? 1 : 2), "maximum height is 1280px (640px for retina)")

        assert(countElements(overlays) <= 100, "maximum number of overlays is 100")

        var requestURLString = requestURLStringBase
        requestURLString += mapID


            var output = encodeCoordinate(coordinates[0].latitude) + encodeCoordinate(coordinates[0].longitude)

            for var i = 1; i < count(coordinates); ++i {
                let a = coordinates[i]
                let b = coordinates[i - 1]
                output += encodeCoordinate(a.latitude - b.latitude)
