- Create folder named tmapswww
- Download and Unzip map package inside tmapswww (Request map package from Tagipedia Team)
- Duplicate Config.Secrets.Example.plist and rename it to 'Config.Secrets.plist' and fill the file with your configration info
- Read our sample for examples
it works using dispatch actions between your APP and TMaps. So your APP dispatch actions to TMaps and TMaps dispatch actions to your APP.
dispatched when TMaps ready to receive dispatches from Your APP. So you should not dispatch any action before TMaps get ready.
@{
@"type": @"READY"
};
dispatched when map loaded and visible to user.
@{
@"type": @"MAP_LOADED"
};
dispatched when features in map tapped.
@{
@"type": @"FEATURES_TAPPED",
@"features": features
};
features
Required NSArray with NSDictionary, each NSDictionary with id, properties keys
dispatched when features in map tapped with the top feature visible to user.
@{
@"type": @"ASSOCIATED_FEATURE_TAPPED",
@"feature_id": feature_id,
@"feature": feature
};
feature_id
Required NSString with valid feature id
feature
Required NSDictionary with id, properties keys
dispatched when select category in map
@{
@"type": @"CATEGORY_MARKED",
@"category": category
};
category
Required valid NSString category
dispatched when error happened in TMaps
@{
@"type": @"ERROR",
@"error": error
};
error
Required NSDictionary with stack key and NSString value
dispatched after MARK_FEATURE ended
@{
@"type": @"FEATURE_MARKED",
@"feature_id": feature_id
};
feature_id
Required NSString with valid feature id
dispatched after HIGHLIGHT_FEATURE ended
@{
@"type": @"FEATURE_HIGHLIGHTED",
@"feature_id": feature_id
};
feature_id
Required NSString with valid feature id
dispatched after SET_ZOOM ended
@{
@"type": @"ZOOM_ENDED"
};
dispatched after SET_CENTER ended
@{
@"type": @"CENTER_ENDED"
};
dispatched after any event happened in TMaps. Your app can send analytics after receive this action.
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Maps",
@"event_action": @"Loaded",
@"event_label": map_name,
@"fields_object": @{
@"map_id": map_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Features",
@"event_action": @"Tapped",
@"event_label": feature_display_name,
@"fields_object": @{
@"map_id": map_id,
@"feature_id": feature_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Features",
@"event_action": @"Highlighted",
@"event_label": feature_display_name,
@"fields_object": @{
@"map_id": map_id,
@"feature_id": feature_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Features",
@"event_action": @"Searched",
@"event_label": feature_display_name,
@"fields_object": @{
@"map_id": map_id,
@"feature_id": feature_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Categories",
@"event_action": @"Highlighted",
@"event_label": category,
@"fields_object": @{
@"map_id": map_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Categories",
@"event_action": @"Searched",
@"event_label": category,
@"fields_object": @{
@"map_id": map_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Routes",
@"event_action": @"Routed",
@"event_label": source_display_name => target_display_name,
@"fields_object": @{
@"map_id": map_id,
@"source_feature_id": source_feature_id,
@"target_feature_id": target_feature_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Buildings",
@"event_action": @"Tapped",
@"event_label": building_name,
@"fields_object": @{
@"map_id": map_id,
@"building_id": building_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Buildings",
@"event_action": @"Opened",
@"event_label": building_name,
@"fields_object": @{
@"map_id": map_id,
@"building_id": building_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"Floors",
@"event_action": @"Opened",
@"event_label": floor_label,
@"fields_object": @{
@"map_id": map_id,
@"layer_id": layer_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"RenderModes",
@"event_action": @"Changed",
@"event_label": render_mode,
@"fields_object": @{
@"map_id": map_id
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"LocationUpdated",
@"event_action": @"Gps",
@"event_label": latitude/longitude,
@"fields_object": @{
@"map_id": map_id,
@"lat": latitude,
@"lng": longitude,
}
};
@{
@"type": @"EVENT_LOGGED",
@"event_category": @"LocationUpdated",
@"event_action": @"Beacon",
@"event_label": latitude/longitude,
@"fields_object": @{
@"map_id": map_id,
@"lat": latitude,
@"lng": longitude,
}
};
dispatched after Tapped GPS Button in TMaps. You Should turn on Location Service and then dispatch Start to begin updating location
@{
@"type": @"CHECK_GPS_AVAILABILITY"
};
dispatched after Tapped Beacon Location Button in TMaps. You Should turn on Bluetooth Service and then dispatch Start to begin updating location
@{
@"type": @"CHECK_BEACON_LOCATION_AVAILABILITY"
};
dispatched after starting updating beacon location in TMaps. You Should start or stop beacon manager according to beacon manager state. if beacon manager state is true you shoud start beacon manager then dispatch the new position to TMaps to update user location
@{
@"type": @"START_POSITION_UPDATES_FOR_BEACON_LOCATION"
@"start_beacon_manager":start_beacon_manager
};
start_beacon_manager
Required Boolean beacon manager state
dispatch it to set tenants of map.
@{
@"type": @"SET_TENANT_DATA",
@"payload": tenants_json
};
payload
Required NSArray with NSDictionary, each NSDictionary with id, feature_id, name, booth_id, icon, CUSTOM_KEYS_YOU_NEED keys
dispatch it to change default feature popup template.
@{
@"type": @"SET_DEFAULT_FEATURE_POPUP_TEMPLATE",
@"template": template,
@"template_custom_data": templateCustomData,
};
template
Required valid NSString angular template with PopupScope
template_custom_data
Optional NSDictionary with CUSTOM_KEYS_YOU_NEED keys and NSString, NSNumber, NSArray, NSDictionary values
template custom data of keys that you want to use from customData in PopupScope
dispatch it to change theme of map.
@{
@"type": @"SET_THEME",
@"theme": @{
@"primary": primary_color,
@"accent": accent_color
}
};
primary
Optional valid NSString color
accent
Optional valid NSString color
dispatch it to load map.
@{
@"type": @"LOAD_MAP",
@"map_id": map_id,
@"theme": @{
@"primary": primary_color,
@"accent": accent_color
},
@"center": @[lng, lat],
@"zoom": zoom
};
map_id
Required NSString
theme
Optional NSDictionary with primary, accent keys and valid NSString color values
theme used for colors such as buttons and loading
center
Optional NSArray of NSNumbers
Default map center in longitude and latitude
zoom
Optional NSNumber
Default zoom level
dispatch it to change render mode.
@{
@"type": @"CHANGE_RENDER_MODE",
@"modeToRender": modeToRender
}
modeToRender Required NSString with 2D, 3D
dispatch it to change zoom of map.
@{
@"type": @"SET_ZOOM",
@"zoom": zoom,
@"zoom_type": zoom_type,
}
zoom Required NSNumber
zoom_type Optional NSString with FLY_TO
dispatch it to change center of map.
@{
@"type": @"SET_CENTER",
@"center": @[lng, lat],
}
center Required NSArray of NSNumbers Default map center in longitude and latitude
dispatch it to highlight feature.
@{
@"type": @"HIGHLIGHT_FEATURE",
@"feature_id": feature_id
}
feature_id Required NSString with valid feature id
dispatch it to mark feature.
@{
@"type": @"MARK_FEATURE",
@"feature_id": feature_id
}
feature_id Required NSString with valid feature id
dispatch it after Map Loaded to show GPS button
@{
@"type": @"ENABLE_GPS_BUTTON"
}
dispatch it after check location service to start updating user location and showing nearest places to user
@{
@"type": @"START_UPDATING_LOCATION",
@"is_gps_activated": is_gps_activated
}
is_gps_activated Required Boolean
Don't forget to add permissions to Info.plist
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>to show nearest area to you</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>to show nearest area to you</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>to show nearest area to you</string>
** Follow our samples **
https://github.com/tagipedia/tmaps-ios-sample/blob/9f8a3b36fc0a0a568c455584d01752e131492f7d/TMapsSample/ViewController.m#L158
https://github.com/tagipedia/tmaps-ios-sample/blob/9f8a3b36fc0a0a568c455584d01752e131492f7d/TMapsSample/ViewController.m#L186-L193
https://github.com/tagipedia/tmaps-ios-sample/blob/9f8a3b36fc0a0a568c455584d01752e131492f7d/TMapsSample/ViewController.m#L195-L227
dispatch it after Map Loaded to show Beacon Location button
@{
@"type": @"ENABLE_BEACON_LOCATION_BUTTON"
}
dispatch it after check beacon location service to start updating user location and showing nearest places to user
@{
@"type": @"START_UPDATING_BEACON_LOCATION",
@"is_beacon_location_activated": is_beacon_location_activated
}
is_beacon_location_activated Required Boolean
dispatch it after beacon location service started to update user location and showing nearest places to user
@{
@"type": @"SET_USER_BEACON_LOCATION",
@"x": x,
@"y": y,
@"origin_lat": origin_lat,
@"origin_lng": origin_lng
}
x
Required NSNumber
y
Required NSNumber
origin_lat
Required NSNumber
origin_lng
Required NSNumber
dispatch it to set device id and device type
@{
@"type": @"SET_DEVICE_DATA",
@"device_id": device_id ,
@"device_type": @"IOS"
}
device_id Required NSString
device_type Required NSString with IOS
dispatch it to set client id and client secret
@{
@"type": @"SET_APPLICATION_SECRETS",
@"client_id": client_id ,
@"client_secret": client_secret
}
client_id Required NSString
client_secret Required NSString
current feature
poi
poi Required poi
Boolean to check if routing is enabled
enableRouting
method to show routing dialog.
showRoutingDialog($event, data)
$event Required $event
data Optional Object with from, to keys and poi value
method to call Angular $apply
applyIfneeded(callback)
callback Required Function
custom data object that have all keys of template_custom_data
customData[key]
key Required with valid key from template_custom_data
method to dispatch action from your APP to TMaps.
dispatch(action)
action Required Object with valid action
method to dispatch action from TMaps to your APP.
dispatchToContainer(action)
action
Required Object with type, CUSTOM_KEYS_YOU_NEED keys.
type is NSString value.
CUSTOM_KEYS_YOU_NEED is any of NSString, NSNumber, NSArray, NSDictionary values.
method to close feature popup
closeInfo()
id of feature
poi.id
category of feature
poi.category
tags of feature
poi.tags
tenant of feature you set in SET_TENANT_DATA
poi.getTenant()
tenant name of feature you set in SET_TENANT_DATA
poi.getTenantName()
tenant icon of feature you set in SET_TENANT_DATA
poi.getTenantIcon()
tenant booth_id of feature you set in SET_TENANT_DATA
poi.getTenantBoothId()
getTenantName or feature name
poi.getDisplayName()
check if tenant or feature have name.
poi.hasName()
check if feature is building.
poi.isBuilding()
getTenantIcon or feature icon
poi.getIcon()
getTenantBoothId or feature booth id
poi.getBoothId()
you should dispatch HIGHLIGHT_FEATURE for initial feature after ZOOM_ENDED/CENTER_ENDED
you should dispatch HIGHLIGHT_FEATURE for initial feature after MAP_LOADED
you should dispatch SET_DEFAULT_FEATURE_POPUP_TEMPLATE for your customized template and add your custom buttons and use dispatchToContainer when button clicked to handle the click action in your APP.
to fix map scrolling in new IOS devices add this line
webView.scrollView.scrollEnabled = false;