GLMapTagsContainer

Objective-C

@interface GLMapTagsContainer : NSObject

Swift

class GLMapTagsContainer : NSObject

GLMapTagsContainer is a base class for objects that contains tags

  • Holds all properties set by setValue:forKey: or initialized from geoJSON

    Declaration

    Objective-C

    @property (readonly) NSDictionary *_Nonnull properties;

    Swift

    var properties: [AnyHashable : Any] { get }
  • Sets properties of object. This can be used by mapcss to apply different styles.

    In MapCSS style if you have for example rule area|z9-[key=value]{ .. style params .. }, “[key=value]” part means, that it will be applied only to objects, which have key equal to value. And this function allows you to set key and value. Other option is to pass keys and values is set them as properties of Features in GeoJSON.

    Declaration

    Objective-C

    - (void)setValue:(NSString *_Nullable)value forKey:(nonnull NSString *)key;

    Swift

    func setValue(_ value: String?, forKey key: String)

    Parameters

    value

    Value to be set, or nil to remove value

    key

    Key to be set

  • Returns value of object style

    Declaration

    Objective-C

    - (GLMapValue *_Nullable)valueForKey:(nonnull NSString *)key;

    Swift

    func value(forKey key: String) -> GLMapValue?

    Parameters

    key

    Key string

    Return Value

    Value that set by [GLMapVectorObject setValue:forKey:] or loaded from geojson

  • Returns array of values of object style

    Map data on OpenStreetMap could contain multiple values for same tag. According standard they should be divided with ;. Internally it’s represented as multiple values for same tag.

    Declaration

    Objective-C

    - (NSArray<GLMapValue *> *_Nullable)valuesForKey:(nonnull NSString *)key;

    Swift

    func values(forKey key: String) -> [GLMapValue]?

    Parameters

    key

    Key string

    Return Value

    Values that tag

  • Returns name of search result.

    Declaration

    Objective-C

    - (GLMapValue *_Nullable)localizedName:
        (nonnull GLMapLocaleSettings *)localeSettings;

    Swift

    func localizedName(_ localeSettings: GLMapLocaleSettings) -> GLMapValue?

    Parameters

    localeSettings

    Locale settings used to find name

    Return Value

    Object name