I'm not entirely sure what you're asking, but if I understood you correctly, this will give you what you want:
extension JSTileMap {
func getObjectPositionOnLayer(layerName: String, objectName: String) -> CGPoint {
var position = CGPoint()
if let objectLayer = groupNamed(layerName) {
if let object: NSDictionary = objectLayer.objectNamed(objectName) {
position = CGPoint(
x: object.valueForKey("x") as! CGFloat,
y: object.valueForKey("y") as! CGFloat
)
}
}
return position
}
}
Example usage:
// Get player start position from the object named "Start", in
// the object layer "Meta Layer".
let startPoint = map.getObjectPositionOnLayer("Meta Layer", objectName: "Start")
player.position = startPoint