Coordinates
Geo locations in Navmii SDK is represented as NMMapCoordinates class instances. As expected, it has two properties: latitude (takes values from -90 to 90) and longitude (takes values from -180 to 180) . You can create NMMapCoordinates instances in two ways: via instance or class methods.
//creates a NMMapCoordinates object representing London coordinates NMMapCoordinates *mapCoordinates = [[NMMapCoordinates alloc] initWithLongitude:-0.12574 andLatitude:51.50833]; //or, alternatively NMMapCoordinates *mapCoordinates = [NMMapCoordinates mapCoordinatesWithLongitude:-0.12574 andLatitude:51.50833];
Navmii SDK also has NMMapRectangle class representing a rectangle area on the map. It can be created throughout initWithMinLongitude:minLatitude:maxLongitude:maxLatitude: and initWithLeftTop:andRightBottom: instance methods and mapRectangleFromCoordinates: class method. The later creates a NMMapRectangle surrounding all the coordinates passed as the argument.
//creates a NMMapRectangle with four double values NMMapRectangle *mapRectangle = [[NMMapRectangle alloc] initWithMinLongitude:minLongitude minLatitude:minLatitude maxLongitude:maxLongitude maxLatitude:maxLatitude]; //or, alternatively NMMapCoordinates *leftTop = [NMMapCoordinates mapCoordinatesWithLongitude:minLongitude andLatitude:maxLatitude]; NMMapCoordinates *rightBottom = [NMMapCoordinates mapCoordinatesWithLongitude:maxLongitude andLatitude:minLatitude]; NMMapRectangle *mapRectangle = [[NMMapRectangle alloc] initWithLeftTop:leftTop andRightBottom:rightBottom];
//creates a NMMapRectangle bounding all the coordinates in coordinatesArray NMMapRectangle *mapRectangle = [NMMapRectangle mapRectangleFromCoordinates:coordinatesArray];