예제 #1
0
    def currentLocation(cls, label=None):
        '''Create a :class:`.SiriObject` for the current location.

        * label -- The label to display on the map pin

        '''
        return DataObjects.create(DataObjects.CurrentLocation, label=label)
예제 #2
0
    def mapItem(cls, locations):
        '''Create a :class:`.SiriObject` map item.

        * locations -- The list of locations to display on the map

        '''
        items = []

        # Create locations for all of the locations in the given list
        for label, location in locations:
            mapItem = DataObjects.create(DataObjects.MapItem, label=label,
                                         location=location)
            items.append(mapItem)

        return Views.create(Views.MapItemSnippet, useCurrentLocation=False,
                            items=items)
예제 #3
0
    def location(cls, street=None, city=None, stateCode=None, countryCode=None,
                 postalCode=None, latitude=None, longitude=None):
        '''Create a :class:`.SiriObject` location.

        * street -- The string containing the street for the location
        * city -- The string containing the city for the location
        * stateCode -- The string containing the state code for the location
        * countryCode -- The string containing the country code for the
                         location
        * postalCode -- The string containing the postal code for the location
        * latitude -- The string containing the latitude for the location
        * longitude -- The string containing the longitude for the location

        '''
        return DataObjects.create(DataObjects.Location, street=street,
               city=city, stateCode=stateCode, countryCode=countryCode,
               postalCode=postalCode, latitude=latitude, longitude=longitude)