Directory | Mobile SDK | Urbi Documentation
Flutter SDK

Directory

You can search for objects in the Urbi directory, handle search results, and use suggestions to refine search queries. The directory contains information about objects of the following types:

  • companies and their branches
  • buildings
  • parking lots
  • public transport stops and metro stations
  • roads (streets, intersections, highways)
  • settlements of various sizes (countries, cities, regions, villages, etc.)
  • various area objects (parks, beaches, etc.)

See the full list of available object types in the ObjectType class description.


To start working with the directory:

  1. Create a search engine.
  2. Build a search query.
  3. Get, handle, and display search results.

To search for objects in the directory, create a SearchManager object and call one of the methods that determines the directory operating mode:

Important

Some methods work only in a specific directory mode.

Example of creating a search engine with an online directory:

import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;

final SearchManager searchManager = sdk.SearchManager.createOnlineManager(context);

To send a search query, create a SearchQuery object using the SearchQueryBuilder and pass it to the search() method.

Any search query must contain three logical components:

  • Object search request (what to search for?). You can formulate the request using one of the methods below:

    • From a text string using the fromQueryText() method. You can formulate a text request to search for a specific object (The Dubai Frame) or to get a list of multiple objects by a criterion (musical instrument stores).

    • By category IDs using the fromRubricIds() method or in combination with a text string using the fromQueryTextAndRubricIds() method. This method is useful for creating a selection of objects of a specific type.

    • By ID of:

      • Organizations using the fromOrgId() method. If a company has multiple branches, all locations will be listed in the response.
      • Buildings using the fromBuildingId() method.
      • Any object using the searchById() method of the search engine.
  • Geographic restriction (where to search?). You can limit the search area using one of the methods below:

    • Search within a polygon: specify coordinates using the setSpatialRestriction() method.

    • Search in a rectangular area of interest: specify coordinates using the setAreaOfInterest() method. This method sets a priority search area but does not strictly limit the search: if no results are found within the area of interest, the search will continue outside the area.

    • Search within a radius around a point: specify the search center using the setGeoPoint() or fromGeoPoint() method and, if necessary, the search radius using the setRadius() method.

      The fromGeoPoint() method works only in online search mode.

    • Arbitrary query: if the object search query is formulated using the fromQueryText() method, you can also specify the geographical restriction in the same text (flowers near the Burj Khalifa).

  • (Optional component) Additional restrictions on search results using one or more of the methods below:

    • Search for objects of a specific type only: list the object types you are interested in using the setAllowedResultTypes() method (for example, buildings only).
    • Filter results: specify a filtering criterion using the setDirectoryFilter() method (for example, by working hours).
    • Sort results: specify a sorting criterion using the setSortingType() method (for example, by rating).
    • Number of results per page: set a limit using the setPageSize() method.
    • Locale for the search query: specify the language and region using the setLocale() method.
  • Find Italian cuisine restaurants in the Jumeirah district of Dubai that are currently open, sorted by rating:

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    // Create a filter for working hours
    final filter = sdk.DirectoryFilter(
        workTime: sdk.WorkTimeFilter.isOpenNow(const sdk.IsOpenNow()), // keep only currently open objects
        dynamic_: [],
    );
    
    final searchQuery = sdk.SearchQueryBuilder
        .fromQueryText("Italian restaurants in Jumeirah Dubai")
        .setDirectoryFilter(filter) // filter by working hours
        .setSortingType(sdk.SortingType.byRating) // sort by rating
        .setPageSize(10) // maximum 10 objects per results page
        .build();
    
  • Find all parking lots within a 1 km radius, sorted by distance:

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    final searchQuery = sdk.SearchQueryBuilder
        .fromQueryText('Parking')
        .setAllowedResultTypes([sdk.ObjectType.parking]) // parkings only
        .setGeoPoint(const sdk.GeoPoint(latitude: sdk.Latitude(59.936), longitude: sdk.Longitude(30.351))) // search center
        .setRadius(const sdk.Meter(1000)) // search radius
        .setSortingType(sdk.SortingType.byDistance) // sort by distance
        .build();
    
  • Find all settlements (cities, villages, towns, etc.) within a polygon:

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    // Create a search area as a polygon
    
    final polygon = [
      const sdk.GeoPoint(
        latitude: sdk.Latitude(55.751244),
        longitude: sdk.Longitude(37.618423),
      ),
      const sdk.GeoPoint(
        latitude: sdk.Latitude(55.751244),
        longitude: sdk.Longitude(37.618423),
      ),
      const sdk.GeoPoint(
        latitude: sdk.Latitude(55.751244),
        longitude: sdk.Longitude(37.618423),
      ),
      const sdk.GeoPoint(
        latitude: sdk.Latitude(55.751244),
        longitude: sdk.Longitude(37.618423),
      ),
    ];
    
    final searchQuery = sdk.SearchQueryBuilder.fromQueryText('city name')
        .setAllowedResultTypes([
          sdk.ObjectType.admDivCity,
          sdk.ObjectType.admDivSettlement,
        ]) // cities and small settlements only
        .setSpatialRestriction(polygon) // search area
        .build();
    
  • Find all objects that provide document printing services in an area of interest:

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    // Create a rectangular area of interest using the coordinates of two corners
    const areaOfInterest = sdk.GeoRect(
      southWestPoint: sdk.GeoPoint(
        latitude: sdk.Latitude(59.931),
        longitude: sdk.Longitude(30.344),
      ), // southwest corner
      northEastPoint: sdk.GeoPoint(
        latitude: sdk.Latitude(59.936),
        longitude: sdk.Longitude(30.351),
      ), // northeast corner
    );
    
    final searchQuery =
        sdk.SearchQueryBuilder.fromQueryText('document printing')
            .setAreaOfInterest(areaOfInterest)
            .build();
    
  • Find all companies at the address "​Trade Center 1, Jumeirah, Dubai":

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    final searchQuery = sdk.SearchQueryBuilder
        .fromQueryText('​Trade Center 1, Jumeirah, Dubai')
        .setAllowedResultTypes([sdk.ObjectType.branch]) // companies only
        .setPageSize(10) // maximum 10 objects per results page
        .build();
    
  • Find all branches of a company by a known ID:

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    const id = 4504136498310300;
    
    final searchQuery = sdk.SearchQueryBuilder
        .fromOrgId(const sdk.OrgId(id))
        .build();
    
  • Find a specific object by a known ID:

    import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;
    
    const id = 70000001035164789;
    
    searchManager.searchById('id');
    

You can modify or add parameters to an already created search query. To do this, create a new SearchQuery object, specify the existing query using the fromQuery() method, and specify the parameters to be additionally applied. For example, change the sorting type for parking lot searches:

import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;

// Create the initial query
final searchQuery = sdk.SearchQueryBuilder
    .fromQueryText('Parking')
    .setAllowedResultTypes([sdk.ObjectType.parking])
    .setGeoPoint(const sdk.GeoPoint(latitude: sdk.Latitude(59.936), longitude: sdk.Longitude(30.351)))
    .setRadius(const sdk.Meter(1000))
    .setSortingType(sdk.SortingType.byDistance) // sort by distance
    .build();

final searchQueryUpdated = sdk.SearchQueryBuilder
    .fromQuery(searchQuery) // reference the initial query
    .setSortingType(sdk.SortingType.byRating) // sort by rating
    .build();

The other parameters of the initial query remain unchanged.

Calling the search() method returns a deferred SearchResult, which contains a paginated list of found objects (DirectoryObject):

final SearchResult result = await widget._searchManager.search(query).value;

final Page? searchPage = result.firstPage;

To get the next page of search results, call the fetchNextPage() page method, which returns a deferred result Page:

import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;

final Page? nextPage = await searchPage?.fetchNextPage()?.value;

The coordinates of all found objects are returned in the itemMarkerInfos field of the SearchResult as a list of ItemMarkerInfo elements. The list may contain no more than 15000 elements.

To display markers for all found objects on the map:

  1. Prepare a list of Marker objects. To set the marker position (the position parameter), use the coordinates from the ItemMarkerInfo.geoPoint field.
  2. Add the prepared set of markers to the map using the addObjects method of the MapObjectManager. For more details, see the guide Adding multiple objects to the map.
import 'package:dgis_mobile_sdk/dgis.dart';

  Future<void> displaySearchResultMarkers(sdk.Map map, sdk.SearchResult searchResult) async {
    // Retrieve the list of markers from the search results
    final loader = sdk.ImageLoader(sdkContext);
    final markerInfos = await searchResult.itemMarkerInfos.value;
    if (markerInfos == null) return;

    // Create an object manager to add markers to the map
    final mapObjectManager = sdk.MapObjectManager(map);

    // Prepare the list of markers
    final markers = markerInfos.map((itemMarkerInfo) async {
      final position = itemMarkerInfo.geoPoint;

      return sdk.Marker(
        sdk.MarkerOptions(
          position: position,
          icon: await loader.loadPngFromAsset('assets/icons/marker_icon.png', 100, 100),
        ),
      );
    }).whereType<sdk.Marker>().toList();

    // Add the markers to the map
    mapObjectManager.addObjects(markers);
  }

Search results from the directory are presented as a list of DirectoryObject objects with sets of properties. Depending on the object type, some properties may not have values.

Important

Access to certain information about objects is only available with additional key configuration for an extra fee: see the field descriptions of DirectoryObject, Address, and ItemMarkerInfo objects. Contact 2GIS support service to update your access key settings.

  • Main properties for object classification:

    • Object type (types) from ObjectType. One object can belong to several types (for example, the Museum of the Future in Dubai is both a museum and a architectural sight). In this case, all types will be listed, with the first element being the main object type.
    • Object name (title) depending on its type: organization name, landmark, or geographic object. For residential buildings without a name - the address.
    • Object subtype (subtitle) to specify the classification. For example, a coffee shop as a subtype of an organization or a residential building as a subtype of a building.
    • Object description (description).
    • Categories that the object belongs to (rubricIds).
    • Organization identifier in the directory and information about it (orgInfo). For companies with multiple branches - information about the head organization.
    • (Data on demand) Grouping of objects of different types in a single directory card (group). For example, a courthouse card contains information about the building as a geographical object and about the court as an organization in the building.
  • Unique object identifier in the directory (id). For companies with multiple branches - the identifier of the particular branch.

  • Geographic properties:

    • Coordinates for placing a marker on the map (markerPosition).
    • Full address of the object (address). Some address components are available only on demand: see the Address object description.
    • (Data on demand) Information about the building floor where the object is located (levelId and buildingLevels). Relevant for companies located on a specific floor of a multi-story building.
    • (Data on demand) Information about entrances to the object (entrances) with coordinates and other data. Relevant not only for companies and buildings, but also for other objects with physically designated entrances (for example, parks).
    • (Data on demand) Additional information to clarify the address (title_addition). For example, entrance number or apartment number.
  • Working hours:

    • Offset of the object local time from UTC in the timestamp form (timeZoneOffset). For example, 03:00:00 for the UTC+3 timezone.
    • Working hours (openingHours) as a list of time intervals or a round-the-clock flag. Relevant for companies.
    • Current work status (workStatus).
  • Other data:

    • (Data on demand) Information about the trade license of the organization (tradeLicense).
    • Contact information for the organization (contactInfos): phone number, e-mail address, website and social network links, and others.
    • Object rating based on user reviews (reviews).
    • Additional parking properties (parkingInfo).
    • Additional charging station properties (chargingStation).
    • Building information (buildingInfo).

Examples

Below are examples of DirectoryObject for different types of directory objects.

  • Organization branch:

    DirectoryObject
    // Object type - organization branch
    types: [ObjectType.branch],
    // Object name
    title: 'Starbucks',
    titleAddition: null,
    // Organization subtype - coffee shop
    subtitle: 'Coffee shop',
    // Object ID (particular organization branch)
    id: DgisObjectId(objectId: 70000001006332208, entranceId: 0),
    // Coordinates of the marker to place on the map
    markerPosition: GeoPointWithElevation(
        latitude: Latitude(value: 25.21653),
        longitude: Longitude(value: 55.252752),
        elevation: Elevation(value: 0.0),
    ),
    // Organization address - 171, Jumeirah road, Dubai
    address: Address(
        drillDown: [
        AddressAdmDiv(type: 'country', name: 'UAE'),
        AddressAdmDiv(type: 'region', name: 'Dubai Emirate'),
        AddressAdmDiv(type: 'district_area', name: 'Dubai Municipality'),
        AddressAdmDiv(type: 'city', name: 'Dubai'),
        AddressAdmDiv(type: 'division', name: 'Jumeirah'),
        AddressAdmDiv(type: 'district', name: 'Jumeirah 1'),
        ],
        components: [
        AddressComponent(
            AddressStreet(
            street: 'Jumeirah road',
            number: '171',
            fiasCode: null,
            ),
        ),
        ],
        buildingName: 'Mercato Mall',
        buildingId: BuildingId(value: 13933647002354225),
        postCode: null,
        buildingCode: null,
        fiasCode: null,
        addressComment: 'G Floor, Shop VS1',
    ),
    // Other attributes: served food, payment types, service languages, and more
    attributes: [
        Attribute(tag: 'food_service_avg_price', value: 'Average bill 25 AED'),
        Attribute(tag: 'food_service_details_food_breakfast', value: 'Breakfast menu'),
        Attribute(tag: 'food_service_details_food_kids_menu', value: 'Kids menu'),
        Attribute(tag: 'food_service_capacity', value: 'Seating capacity 90 people'),
        Attribute(tag: 'covid_homedelivery', value: 'Delivery'),
        Attribute(tag: 'daily_services_wifi', value: 'Wi-Fi'),
        Attribute(tag: 'general_payment_type_card', value: 'Card payment'),
        Attribute(tag: 'general_payment_type_cash', value: 'Cash payment'),
        Attribute(tag: 'service_language_english', value: 'English'),
        Attribute(tag: 'service_language_hindi', value: 'Hindi'),
        Attribute(tag: 'service_language_tagalog', value: 'Tagalog'),
        Attribute(tag: 'accessible_entrance_accessible_entrance', value: 'Wheelchair Accessible'),
    ],
    contextAttributes: [],
    // Local timezone - UTC+4
    timeZoneOffset: Duration(hours: 4),
    // The branch is open every day from 8:00 to 23:00
    openingHours: OpeningHours(
        weekOpeningHours: [
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.monday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.monday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.tuesday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.tuesday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.wednesday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.wednesday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.thursday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.thursday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.friday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.friday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.saturday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.saturday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.sunday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.sunday, time: DayTime(hours: 23, minutes: 0)),
            ),
        ],
        ],
        isOpen24x7: false,
    ),
    // Ways to contact the organization
    contactInfos: [
        ContactInfo(type: 'website', displayText: 'starbucks.com', value: 'http://starbucks.com', comment: null),
        ContactInfo(type: 'twitter', displayText: 'https://twitter.com/starbucks', value: 'https://twitter.com/starbucks', comment: null),
        ContactInfo(type: 'facebook', displayText: 'https://facebook.com/StarbucksMiddleEast', value: 'https://facebook.com/StarbucksMiddleEast', comment: null),
        ContactInfo(type: 'instagram', displayText: 'https://instagram.com/starbucksmiddleeast', value: 'https://instagram.com/starbucksmiddleeast', comment: null),
        ContactInfo(type: 'linkedin', displayText: 'https://linkedin.com/company/starbucks', value: 'https://linkedin.com/company/starbucks', comment: null),
        ContactInfo(type: 'pinterest', displayText: 'https://pinterest.com/starbucks', value: 'https://pinterest.com/starbucks', comment: null),
        ContactInfo(type: 'youtube', displayText: 'https://youtube.com/user/Starbucks', value: 'https://youtube.com/user/Starbucks', comment: null),
        ContactInfo(type: 'pobox', displayText: 'P.O.Box 1277', value: '1277', comment: null),
        ContactInfo(type: 'phone', displayText: '+971 4 3153636', value: '+97143153636', comment: null),
        ContactInfo(type: 'email', displayText: 'sbk.mercato-uae@alshaya.com', value: 'sbk.mercato-uae@alshaya.com', comment: null),
    ],
    // Rating is 4.0 based on 25 reviews
    reviews: Reviews(rating: 4.0, count: 25),
    parkingInfo: null,
    // The branch is currently open and will be until 23:00
    workStatus: WorkStatus(isOpen: true, description: 'Open until 23:00'),
    // The branch is located on the G floor of the building
    levelId: LevelId(value: 70030076166076253),
    buildingLevels: null,
    // The organization has three entrances
    entrances: [
        EntranceInfo(
        id: DgisObjectId(objectId: 70000001006332208, entranceId: 139336470023548743),
        buildingNumber: null,
        porchName: null,
        porchNumber: null,
        apartmentRanges: [],
        geometry: EntranceGeometry(
            entrancePoints: [
            GeoPoint(latitude: Latitude(value: 25.216795), longitude: Longitude(value: 55.25238)),
            GeoPoint(latitude: Latitude(value: 25.216828), longitude: Longitude(value: 55.253393)),
            GeoPoint(latitude: Latitude(value: 25.215802), longitude: Longitude(value: 55.252601)),
            ],
            entrancePolylines: [
            [
                GeoPoint(latitude: Latitude(value: 25.216846), longitude: Longitude(value: 55.252298)),
                GeoPoint(latitude: Latitude(value: 25.216795), longitude: Longitude(value: 55.25238)),
            ],
            [
                GeoPoint(latitude: Latitude(value: 25.216902), longitude: Longitude(value: 55.253455)),
                GeoPoint(latitude: Latitude(value: 25.216828), longitude: Longitude(value: 55.253393)),
            ],
            [
                GeoPoint(latitude: Latitude(value: 25.215737), longitude: Longitude(value: 55.252301)),
                GeoPoint(latitude: Latitude(value: 25.215802), longitude: Longitude(value: 55.252601)),
            ],
            ],
        ),
        ),
    ],
    chargingStation: null,
    // The object belongs to one category
    rubricIds: [RubricId(value: 162)],
    // Information about the head organization and the total count of branches
    orgInfo: OrgInfo(
        branchCount: 310,
        id: OrgId(value: 70000001033047305),
        name: 'Starbucks, coffee shop',
    ),
    group: [],
    
  • Residential building:

    DirectoryObject
    // Object type - building
    types: [ObjectType.building],
    // Object name
    title: 'DT-1 Ellington Tower',
    titleAddition: null,
    // Object subtype - residential building
    subtitle: 'Residential building',
    // Object ID
    id: DgisObjectId(objectId: 70030076167127391, entranceId: 0),
    // Coordinates of the marker to place on the map
    markerPosition: GeoPointWithElevation(
        latitude: Latitude(value: 25.191471),
        longitude: Longitude(value: 55.269194),
        elevation: Elevation(value: 9.0),
    ),
    // Organization address - 7, Burj Khalifa street, Dubai
    address: Address(
        drillDown: [
        AddressAdmDiv(type: 'country', name: 'UAE'),
        AddressAdmDiv(type: 'region', name: 'Dubai Emirate'),
        AddressAdmDiv(type: 'district_area', name: 'Dubai Municipality'),
        AddressAdmDiv(type: 'city', name: 'Dubai'),
        AddressAdmDiv(type: 'division', name: "Za'abeel"),
        AddressAdmDiv(type: 'district', name: 'Burj Khalifa/Downtown Dubai'),
        ],
        components: [
        AddressComponent(
            AddressStreet(
            street: 'Burj Khalifa street',
            number: '7',
            fiasCode: null,
            ),
        ),
        ],
        buildingName: null,
        buildingId: BuildingId(value: 70030076167127391),
        postCode: null,
        buildingCode: null,
        fiasCode: null,
        addressComment: null,
    ),
    attributes: [],
    contextAttributes: [],
    timeZoneOffset: null,
    openingHours: null,
    contactInfos: [],
    reviews: null,
    parkingInfo: null,
    workStatus: WorkStatus(isOpen: false, description: ''),
    levelId: null,
    buildingLevels: null,
    // The building has four entrances
    entrances: [
        EntranceInfo(
        id: DgisObjectId(objectId: 70030076167127391, entranceId: 70030076324754702),
        buildingNumber: null,
        porchName: null,
        porchNumber: null,
        apartmentRanges: [],
        geometry: EntranceGeometry(
            entrancePoints: [
            GeoPoint(
                latitude: Latitude(value: 25.19140378756845),
                longitude: Longitude(value: 55.26913163325181),
            ),
            ],
            entrancePolylines: [
            [
                GeoPoint(
                latitude: Latitude(value: 25.191347),
                longitude: Longitude(value: 55.269055),
                ),
                GeoPoint(
                latitude: Latitude(value: 25.191404),
                longitude: Longitude(value: 55.269132),
                ),
            ],
            ],
        ),
        ),
        EntranceInfo(
        id: DgisObjectId(objectId: 70030076167127391, entranceId: 7003007632475404),
        buildingNumber: null,
        porchName: null,
        porchNumber: null,
        apartmentRanges: [],
        geometry: EntranceGeometry(
            entrancePoints: [
            GeoPoint(
                latitude: Latitude(value: 25.19158093529474),
                longitude: Longitude(value: 55.2695519032598),
            ),
            ],
            entrancePolylines: [
            [
                GeoPoint(
                latitude: Latitude(value: 25.191915),
                longitude: Longitude(value: 55.269672),
                ),
                GeoPoint(
                latitude: Latitude(value: 25.191858),
                longitude: Longitude(value: 55.269595),
                ),
            ],
            ],
        ),
        ),
        EntranceInfo(
        id: DgisObjectId(objectId: 70030076167127391, entranceId: 7003007632475407),
        buildingNumber: null,
        porchName: null,
        porchNumber: null,
        apartmentRanges: [],
        geometry: EntranceGeometry(
            entrancePoints: [
            GeoPoint(
                latitude: Latitude(value: 25.19173213009156),
                longitude: Longitude(value: 55.26907392050657),
            ),
            ],
            entrancePolylines: [
            [
                GeoPoint(
                latitude: Latitude(value: 25.191789),
                longitude: Longitude(value: 55.269785),
                ),
                GeoPoint(
                latitude: Latitude(value: 25.191732),
                longitude: Longitude(value: 55.269701),
                ),
            ],
            ],
        ),
        ),
        EntranceInfo(
        id: DgisObjectId(objectId: 70030076167127391, entranceId: 70030076269579911),
        buildingNumber: null,
        porchName: 'Entrance 1',
        porchNumber: 1,
        apartmentRanges: [],
        geometry: EntranceGeometry(
            entrancePoints: [
            GeoPoint(
                latitude: Latitude(value: 25.191795238515603),
                longitude: Longitude(value: 55.26951389492054),
            ),
            ],
            entrancePolylines: [
            [
                GeoPoint(
                latitude: Latitude(value: 25.191852),
                longitude: Longitude(value: 55.269728),
                ),
                GeoPoint(
                latitude: Latitude(value: 25.191795),
                longitude: Longitude(value: 55.269651),
                ),
            ],
            ],
        ),
        ),
    ],
    chargingStation: null,
    rubricIds: [],
    orgInfo: null,
    group: [],
    
  • Street:

    DirectoryObject
    // Object type - street
    types: [ObjectType.street],
    // Object name
    title: '9 street',
    titleAddition: null,
    // Object subtype - street
    subtitle: 'Street',
    // Object ID
    id: DgisObjectId(objectId: 13933750081556578, entranceId: 0),
    // Coordinates of the marker to place on the map
    markerPosition: GeoPointWithElevation(
        latitude: Latitude(value: 25.166536),
        longitude: Longitude(value: 55.261352),
        elevation: Elevation(value: 0.0),
    ),
    // Organization address - Dubai, Al Qouz 1
    address: Address(
        drillDown: [
        AddressAdmDiv(type: 'country', name: 'UAE'),
        AddressAdmDiv(type: 'region', name: 'Dubai Emirate'),
        AddressAdmDiv(type: 'district_area', name: 'Dubai Municipality'),
        AddressAdmDiv(type: 'city', name: 'Dubai'),
        AddressAdmDiv(type: 'district', name: 'Al Qouz 1'),
        ],
        components: [],
        buildingName: null,
        buildingId: null,
        postCode: null,
        buildingCode: null,
        fiasCode: null,
        addressComment: null,
    ),
    attributes: [],
    contextAttributes: [],
    timeZoneOffset: null,
    openingHours: null,
    contactInfos: [],
    reviews: null,
    parkingInfo: null,
    workStatus: WorkStatus(isOpen: false, description: ''),
    levelId: null,
    buildingLevels: null,
    entrances: [],
    chargingStation: null,
    rubricIds: [],
    orgInfo: null,
    group: [],
    
  • Polygon object (park):

    DirectoryObject
    // Object type - organization branch
    types: [ObjectType.branch],
    // Object name
    title: 'Al Nahda Pond Park',
    titleAddition: null,
    // Object subtype - park
    subtitle: 'Parks',
    // Object ID
    id: DgisObjectId(objectId: 70000001067100914, entranceId: 0),
    // Coordinates of the marker to place on the map
    markerPosition: GeoPointWithElevation(
        latitude: Latitude(value: 25.290345),
        longitude: Longitude(value: 55.380582),
        elevation: Elevation(value: 3.0),
    ),
    // Organization address - 4, 22 street, Al Nahda 2, Dubai
    address: Address(
        drillDown: [
        AddressAdmDiv(type: 'country', name: 'UAE'),
        AddressAdmDiv(type: 'region', name: 'Dubai Emirate'),
        AddressAdmDiv(type: 'district_area', name: 'Dubai Municipality'),
        AddressAdmDiv(type: 'city', name: 'Dubai'),
        AddressAdmDiv(type: 'division', name: 'Deira'),
        AddressAdmDiv(type: 'district', name: 'Al Nahda 2'),
        ],
        components: [
        AddressComponent(
            AddressStreet(
            street: '22 street',
            number: '4',
            fiasCode: null,
            ),
        ),
        ],
        buildingName: null,
        buildingId: BuildingId(value: 13933647002428254),
        postCode: null,
        buildingCode: null,
        fiasCode: null,
        addressComment: null,
    ),
    // Other attributes: entrance fee and available facilities
    attributes: [
        Attribute(tag: 'summer_entrance_parks_free', value: 'Free Entrance'),
        Attribute(tag: 'summer_optional_parks_playground', value: 'Playground'),
        Attribute(tag: 'summer_optional_parks_jogging_track', value: 'Jogging Track'),
        Attribute(tag: 'summer_optional_parks_sports_facilities', value: 'Sports Facilities'),
    ],
    contextAttributes: [],
    // Local timezone - UTC+4
    timeZoneOffset: Duration(hours: 4),
    // The object is open every day from 8:00 to 1:00
    openingHours: OpeningHours(
        weekOpeningHours: [
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.monday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.monday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.tuesday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.tuesday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.wednesday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.wednesday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.thursday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.thursday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.friday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.friday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.saturday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.saturday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        [
            WeekTimeInterval(
            startTime: WeekTime(weekDay: WeekDay.sunday, time: DayTime(hours: 8, minutes: 0)),
            finishTime: WeekTime(weekDay: WeekDay.sunday, time: DayTime(hours: 1, minutes: 0)),
            ),
        ],
        ],
        isOpen24x7: false,
    ),
    contactInfos: [],
    reviews: null,
    parkingInfo: null,
    // The branch is currently open and will be until 01:00
    workStatus: WorkStatus(isOpen: true, description: 'Open until 01:00'),
    levelId: null,
    buildingLevels: null,
    // The organization has one entrance
    entrances: [
        EntranceInfo(
        id: DgisObjectId(objectId: 70000001067100914, entranceId: 70030076171889579),
        buildingNumber: null,
        porchName: null,
        porchNumber: null,
        apartmentRanges: [],
        geometry: EntranceGeometry(
            entrancePoints: [
            GeoPoint(
                latitude: Latitude(value: 25.290353695590525),
                longitude: Longitude(value: 55.38058040032387),
            ),
            ],
            entrancePolylines: [
            [
                GeoPoint(
                latitude: Latitude(value: 25.290443),
                longitude: Longitude(value: 55.380568),
                ),
                GeoPoint(
                latitude: Latitude(value: 25.290354),
                longitude: Longitude(value: 55.38058),
                ),
            ],
            ],
        ),
        ),
    ],
    chargingStation: null,
    // The object belongs to one category
    rubricIds: [RubricId(value: 168)],
    // Information about the head organization, which is equal to the current branch
    orgInfo: OrgInfo(
        branchCount: 1,
        id: OrgId(value: 70000001067100913),
        name: 'Al Nahda Pond Park',
    ),
    group: [],
    

You can build suggestions when text searching for objects (see Suggest API). To do this, create a SuggestQuery object using SuggestQueryBuilder and pass it to the suggest() method:

import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;

final SuggestQuery suggestQuery = sdk.SuggestQueryBuilder.fromQueryText(query).build();

final SuggestQuery = await searchManager.suggest(suggestQuery).value;

The method returns a deferred SuggestResult, which contains a list of suggestions (Suggest).

You can search for addresses in the directory with the exact apartment or entrance number.

DgisObjectId contains two identifiers:

  • objectId - stable numeric identifier of the object.
  • entranceId - stable numeric identifier of the object entrance.

If the entranceId is non-zero, then the search result is not a building but a specific entrance.

If you need to draw a marker on a specific entrance or get its coordinates to calculate a route, do not use markerPosition. This property contains the position related to the marker of the building. To get the entrance position, use the information from entrances:

import 'package:dgis_mobile_sdk_map/dgis.dart' as sdk;

sdk.GeoPoint? getMarkerPosition(sdk.DirectoryObject directoryObject) {
  final int entranceId = directoryObject.id?.entranceId ?? 0;
  if (entranceId != 0) {
    return directoryObject.entrances
            .firstWhere((entrance) => entrance.id.entranceId == entranceId)
            .geometry
            ?.entrancePoints
            .firstOrNull ??
        directoryObject.markerPosition?.point;
  }
  return null;
}