@situm/cordova 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (313) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/CHANGELOG_UNRELEASED.md +28 -0
  3. package/Jenkinsfile +84 -0
  4. package/LICENSE +21 -0
  5. package/README.md +472 -0
  6. package/azure/common-steps.yaml +5 -0
  7. package/azure-pipelines.yml +336 -0
  8. package/docs/JSDoc/MapView.html +300 -0
  9. package/docs/JSDoc/MapViewControllerImpl.html +299 -0
  10. package/docs/JSDoc/Situm.html +5257 -0
  11. package/docs/JSDoc/android_Interfaces.js.html +825 -0
  12. package/docs/JSDoc/android_situm.js.html +380 -0
  13. package/docs/JSDoc/fonts/glyphicons-halflings-regular.eot +0 -0
  14. package/docs/JSDoc/fonts/glyphicons-halflings-regular.svg +288 -0
  15. package/docs/JSDoc/fonts/glyphicons-halflings-regular.ttf +0 -0
  16. package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff +0 -0
  17. package/docs/JSDoc/fonts/glyphicons-halflings-regular.woff2 +0 -0
  18. package/docs/JSDoc/global.html +7538 -0
  19. package/docs/JSDoc/img/toast-ui.png +0 -0
  20. package/docs/JSDoc/index.html +90 -0
  21. package/docs/JSDoc/map-view-controller.js.html +307 -0
  22. package/docs/JSDoc/map-view.js.html +172 -0
  23. package/docs/JSDoc/scripts/jquery.min.js +2 -0
  24. package/docs/JSDoc/scripts/linenumber.js +30 -0
  25. package/docs/JSDoc/scripts/prettify/Apache-License-2.0.txt +202 -0
  26. package/docs/JSDoc/scripts/prettify/lang-css.js +2 -0
  27. package/docs/JSDoc/scripts/prettify/prettify.js +28 -0
  28. package/docs/JSDoc/scripts/tui-doc.js +200 -0
  29. package/docs/JSDoc/styles/bootstrap.min.css +6 -0
  30. package/docs/JSDoc/styles/custom.css +23 -0
  31. package/docs/JSDoc/styles/prettify-jsdoc.css +111 -0
  32. package/docs/JSDoc/styles/prettify-tomorrow.css +132 -0
  33. package/docs/JSDoc/styles/tui-doc.css +485 -0
  34. package/docs/conf.json +28 -0
  35. package/docs/getting-started.md +298 -0
  36. package/docs/imagotype-SITUM-transparent-90.png +0 -0
  37. package/docs/static/styles/custom.css +23 -0
  38. package/package.json +60 -0
  39. package/plugin.xml +102 -0
  40. package/scripts/update_changelog.sh +22 -0
  41. package/src/android/app/build.gradle +51 -0
  42. package/src/android/app/proguard-rules.pro +21 -0
  43. package/src/android/app/src/main/AndroidManifest.xml +11 -0
  44. package/src/android/app/src/main/java/es/situm/plugin/DateUtils.java +15 -0
  45. package/src/android/app/src/main/java/es/situm/plugin/PluginHelper.java +919 -0
  46. package/src/android/app/src/main/java/es/situm/plugin/SitumMapper.java +968 -0
  47. package/src/android/app/src/main/java/es/situm/plugin/SitumPlugin.java +109 -0
  48. package/src/android/app/src/main/res/drawable/ic_launcher_background.xml +170 -0
  49. package/src/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +34 -0
  50. package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  51. package/src/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
  52. package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  53. package/src/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  54. package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  55. package/src/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  56. package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  57. package/src/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  58. package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  59. package/src/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  60. package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  61. package/src/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  62. package/src/android/app/src/main/res/values/colors.xml +6 -0
  63. package/src/android/app/src/main/res/values/strings.xml +3 -0
  64. package/src/android/app/src/main/res/values/styles.xml +11 -0
  65. package/src/android/app/src/test/java/es/situm/plugin/PluginHelperTest.java +27 -0
  66. package/src/android/app/src/test/java/es/situm/plugin/SitumMapperTest.java +1485 -0
  67. package/src/android/app/src/test/java/es/situm/plugin/angle/AngleCreator.java +46 -0
  68. package/src/android/app/src/test/java/es/situm/plugin/bounds/BoundsCreator.java +50 -0
  69. package/src/android/app/src/test/java/es/situm/plugin/building/BuildingCreator.java +76 -0
  70. package/src/android/app/src/test/java/es/situm/plugin/cartesianCoordinate/CartesianCoordinateCreator.java +31 -0
  71. package/src/android/app/src/test/java/es/situm/plugin/circle/CircleCreator.java +41 -0
  72. package/src/android/app/src/test/java/es/situm/plugin/coordinate/CoordinateCreator.java +32 -0
  73. package/src/android/app/src/test/java/es/situm/plugin/dimensions/DimensionsCreator.java +31 -0
  74. package/src/android/app/src/test/java/es/situm/plugin/directionsRequest/DirectionsRequestCreator.java +105 -0
  75. package/src/android/app/src/test/java/es/situm/plugin/event/EventCreator.java +108 -0
  76. package/src/android/app/src/test/java/es/situm/plugin/floor/FloorCreator.java +58 -0
  77. package/src/android/app/src/test/java/es/situm/plugin/indication/IndicationCreator.java +40 -0
  78. package/src/android/app/src/test/java/es/situm/plugin/location/LocationCreator.java +197 -0
  79. package/src/android/app/src/test/java/es/situm/plugin/locationRequest/LocationRequestCreator.java +45 -0
  80. package/src/android/app/src/test/java/es/situm/plugin/locationStatus/LocationStatusCreator.java +211 -0
  81. package/src/android/app/src/test/java/es/situm/plugin/navigationProgress/NavigationProgressCreator.java +154 -0
  82. package/src/android/app/src/test/java/es/situm/plugin/poi/PoiCreator.java +126 -0
  83. package/src/android/app/src/test/java/es/situm/plugin/poiCategory/PoiCategoryCreator.java +38 -0
  84. package/src/android/app/src/test/java/es/situm/plugin/point/PointCreator.java +200 -0
  85. package/src/android/app/src/test/java/es/situm/plugin/route/RouteCreator.java +142 -0
  86. package/src/android/app/src/test/java/es/situm/plugin/routeStep/RouteStepCreator.java +173 -0
  87. package/src/android/app/src/test/java/es/situm/plugin/situmConversionArea/SitumConversionAreaCreator.java +35 -0
  88. package/src/android/build.gradle +31 -0
  89. package/src/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  90. package/src/android/gradle/wrapper/gradle-wrapper.properties +6 -0
  91. package/src/android/gradle.properties +16 -0
  92. package/src/android/gradlew +172 -0
  93. package/src/android/gradlew.bat +84 -0
  94. package/src/android/settings.gradle +3 -0
  95. package/src/android/situm.gradle +19 -0
  96. package/src/ios/Classes/Private/CDVDebug.h +25 -0
  97. package/src/ios/Classes/Private/CDVJSON_private.h +31 -0
  98. package/src/ios/Classes/Private/CDVJSON_private.m +99 -0
  99. package/src/ios/Classes/Private/CDVPlugin+Private.h +24 -0
  100. package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.h +26 -0
  101. package/src/ios/Classes/Private/CDVPlugins/CDVGestureHandler/CDVGestureHandler.m +70 -0
  102. package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.h +27 -0
  103. package/src/ios/Classes/Private/CDVPlugins/CDVHandleOpenURL/CDVHandleOpenURL.m +86 -0
  104. package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.h +34 -0
  105. package/src/ios/Classes/Private/CDVPlugins/CDVIntentAndNavigationFilter/CDVIntentAndNavigationFilter.m +153 -0
  106. package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.h +50 -0
  107. package/src/ios/Classes/Private/CDVPlugins/CDVLocalStorage/CDVLocalStorage.m +487 -0
  108. package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.h +26 -0
  109. package/src/ios/Classes/Private/CDVPlugins/CDVLogger/CDVLogger.m +37 -0
  110. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.h +41 -0
  111. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewDelegate.m +399 -0
  112. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.h +27 -0
  113. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewEngine.m +202 -0
  114. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.h +29 -0
  115. package/src/ios/Classes/Private/CDVPlugins/CDVUIWebViewEngine/CDVUIWebViewNavigationDelegate.m +153 -0
  116. package/src/ios/Classes/Public/CDV.h +32 -0
  117. package/src/ios/Classes/Public/CDVAppDelegate.h +28 -0
  118. package/src/ios/Classes/Public/CDVAppDelegate.m +118 -0
  119. package/src/ios/Classes/Public/CDVAvailability.h +111 -0
  120. package/src/ios/Classes/Public/CDVAvailabilityDeprecated.h +26 -0
  121. package/src/ios/Classes/Public/CDVCommandDelegate.h +51 -0
  122. package/src/ios/Classes/Public/CDVCommandDelegateImpl.h +36 -0
  123. package/src/ios/Classes/Public/CDVCommandDelegateImpl.m +186 -0
  124. package/src/ios/Classes/Public/CDVCommandQueue.h +39 -0
  125. package/src/ios/Classes/Public/CDVCommandQueue.m +194 -0
  126. package/src/ios/Classes/Public/CDVConfigParser.h +30 -0
  127. package/src/ios/Classes/Public/CDVConfigParser.m +81 -0
  128. package/src/ios/Classes/Public/CDVInvokedUrlCommand.h +52 -0
  129. package/src/ios/Classes/Public/CDVInvokedUrlCommand.m +116 -0
  130. package/src/ios/Classes/Public/CDVPlugin+Resources.h +39 -0
  131. package/src/ios/Classes/Public/CDVPlugin+Resources.m +38 -0
  132. package/src/ios/Classes/Public/CDVPlugin.h +85 -0
  133. package/src/ios/Classes/Public/CDVPlugin.m +202 -0
  134. package/src/ios/Classes/Public/CDVPluginResult.h +66 -0
  135. package/src/ios/Classes/Public/CDVPluginResult.m +186 -0
  136. package/src/ios/Classes/Public/CDVScreenOrientationDelegate.h +33 -0
  137. package/src/ios/Classes/Public/CDVTimer.h +27 -0
  138. package/src/ios/Classes/Public/CDVTimer.m +123 -0
  139. package/src/ios/Classes/Public/CDVURLProtocol.h +27 -0
  140. package/src/ios/Classes/Public/CDVURLProtocol.m +113 -0
  141. package/src/ios/Classes/Public/CDVUserAgentUtil.h +27 -0
  142. package/src/ios/Classes/Public/CDVUserAgentUtil.m +124 -0
  143. package/src/ios/Classes/Public/CDVViewController.h +92 -0
  144. package/src/ios/Classes/Public/CDVViewController.m +821 -0
  145. package/src/ios/Classes/Public/CDVWebViewEngineProtocol.h +42 -0
  146. package/src/ios/Classes/Public/CDVWhitelist.h +34 -0
  147. package/src/ios/Classes/Public/CDVWhitelist.m +285 -0
  148. package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.h +35 -0
  149. package/src/ios/Classes/Public/NSDictionary+CordovaPreferences.m +63 -0
  150. package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.h +29 -0
  151. package/src/ios/Classes/Public/NSMutableArray+QueueAdditions.m +58 -0
  152. package/src/ios/Cordova/Cordova.h +51 -0
  153. package/src/ios/Cordova/Info.plist +24 -0
  154. package/src/ios/Podfile +5 -0
  155. package/src/ios/SitumCordovaPlugin.xcodeproj/project.pbxproj +1324 -0
  156. package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  157. package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  158. package/src/ios/SitumCordovaPlugin.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
  159. package/src/ios/SitumCordovaPlugin.xcodeproj/xcshareddata/xcschemes/CordovaLib.xcscheme +100 -0
  160. package/src/ios/SitumCordovaPlugin.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  161. package/src/ios/SitumCordovaPlugin_Prefix.pch +22 -0
  162. package/src/ios/VERSION +1 -0
  163. package/src/ios/cordova.js +2432 -0
  164. package/src/ios/situmcordovaplugin/AppDelegate.h +22 -0
  165. package/src/ios/situmcordovaplugin/AppDelegate.m +98 -0
  166. package/src/ios/situmcordovaplugin/Assets.xcassets/AppIcon.appiconset/Contents.json +98 -0
  167. package/src/ios/situmcordovaplugin/Base.lproj/LaunchScreen.storyboard +25 -0
  168. package/src/ios/situmcordovaplugin/Base.lproj/Main.storyboard +24 -0
  169. package/src/ios/situmcordovaplugin/Constants.h +14 -0
  170. package/src/ios/situmcordovaplugin/Constants.m +14 -0
  171. package/src/ios/situmcordovaplugin/Info.plist +45 -0
  172. package/src/ios/situmcordovaplugin/SITUtils.h +7 -0
  173. package/src/ios/situmcordovaplugin/SITUtils.m +13 -0
  174. package/src/ios/situmcordovaplugin/SitumLocationWrapper.h +109 -0
  175. package/src/ios/situmcordovaplugin/SitumLocationWrapper.m +983 -0
  176. package/src/ios/situmcordovaplugin/SitumPlugin.h +41 -0
  177. package/src/ios/situmcordovaplugin/SitumPlugin.m +752 -0
  178. package/src/ios/situmcordovaplugin/ViewController.h +15 -0
  179. package/src/ios/situmcordovaplugin/ViewController.m +29 -0
  180. package/src/ios/situmcordovaplugin/main.m +16 -0
  181. package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/.xccurrentversion +8 -0
  182. package/src/ios/situmcordovaplugin/situmcordovaplugin.xcdatamodeld/situmcordovaplugin.xcdatamodel/contents +4 -0
  183. package/src/ios/situmcordovaplugintests/AngleTests.m +53 -0
  184. package/src/ios/situmcordovaplugintests/BoundTests.m +51 -0
  185. package/src/ios/situmcordovaplugintests/BuildingTests.m +41 -0
  186. package/src/ios/situmcordovaplugintests/CartesianCoordinateTests.m +42 -0
  187. package/src/ios/situmcordovaplugintests/ConversionAreaTests.m +43 -0
  188. package/src/ios/situmcordovaplugintests/CoordinateTests.m +42 -0
  189. package/src/ios/situmcordovaplugintests/DimensionTests.m +43 -0
  190. package/src/ios/situmcordovaplugintests/EventTests.m +42 -0
  191. package/src/ios/situmcordovaplugintests/FloorTests.m +52 -0
  192. package/src/ios/situmcordovaplugintests/Info.plist +38 -0
  193. package/src/ios/situmcordovaplugintests/InputTests/DirectionsRequestTest.m +108 -0
  194. package/src/ios/situmcordovaplugintests/InputTests/InputCartesianCoordinateTests.m +45 -0
  195. package/src/ios/situmcordovaplugintests/InputTests/InputCoordinateTests.m +45 -0
  196. package/src/ios/situmcordovaplugintests/InputTests/InputFloorTests.m +59 -0
  197. package/src/ios/situmcordovaplugintests/InputTests/InputIndicationTests.m +45 -0
  198. package/src/ios/situmcordovaplugintests/InputTests/InputLocationTests.m +163 -0
  199. package/src/ios/situmcordovaplugintests/InputTests/InputPoiCategoryTests.m +46 -0
  200. package/src/ios/situmcordovaplugintests/InputTests/InputPointTests.m +137 -0
  201. package/src/ios/situmcordovaplugintests/InputTests/LocationRequestTest.m +79 -0
  202. package/src/ios/situmcordovaplugintests/LocationStatusTests.m +60 -0
  203. package/src/ios/situmcordovaplugintests/LocationTests.m +114 -0
  204. package/src/ios/situmcordovaplugintests/NavigationProgressTests.m +50 -0
  205. package/src/ios/situmcordovaplugintests/PoiCategoryIconTests.m +43 -0
  206. package/src/ios/situmcordovaplugintests/PoiCategoryTests.m +42 -0
  207. package/src/ios/situmcordovaplugintests/PoiTests.m +83 -0
  208. package/src/ios/situmcordovaplugintests/PointTests.m +107 -0
  209. package/src/ios/situmcordovaplugintests/RouteStepTests.m +78 -0
  210. package/src/ios/situmcordovaplugintests/RouteTests.m +42 -0
  211. package/src/ios/situmcordovaplugintests/SitumCreatorTests.h +91 -0
  212. package/src/ios/situmcordovaplugintests/SitumCreatorTests.m +928 -0
  213. package/src/ios/situmcordovaplugintests/TestingHelper.h +48 -0
  214. package/src/ios/situmcordovaplugintests/TestingHelper.m +342 -0
  215. package/src/ios/situmcordovaplugintests/indicationTests.m +43 -0
  216. package/tests/common-resources/angle/angle1.json +6 -0
  217. package/tests/common-resources/angle/angle2.json +6 -0
  218. package/tests/common-resources/bounds/bounds1.json +18 -0
  219. package/tests/common-resources/bounds/bounds2.json +18 -0
  220. package/tests/common-resources/building/building1.json +64 -0
  221. package/tests/common-resources/cartesianCoordinate/cartesianCoordinate1.json +4 -0
  222. package/tests/common-resources/circle/circle1.json +17 -0
  223. package/tests/common-resources/coordinate/coordinate1.json +4 -0
  224. package/tests/common-resources/dimensions/dimensions1.json +4 -0
  225. package/tests/common-resources/directionsRequest/directionsRequest1.json +166 -0
  226. package/tests/common-resources/directionsRequest/directionsRequest2.json +167 -0
  227. package/tests/common-resources/directionsRequest/directionsRequest3.json +166 -0
  228. package/tests/common-resources/directionsRequest/directionsRequest4.json +166 -0
  229. package/tests/common-resources/directionsRequest/directionsRequest5.json +167 -0
  230. package/tests/common-resources/directionsRequest/directionsRequest6.json +153 -0
  231. package/tests/common-resources/events/event1.json +66 -0
  232. package/tests/common-resources/floor/floor1.json +13 -0
  233. package/tests/common-resources/floor/floor2.json +13 -0
  234. package/tests/common-resources/indication/indication1.json +10 -0
  235. package/tests/common-resources/location/location1.json +48 -0
  236. package/tests/common-resources/location/location10.json +48 -0
  237. package/tests/common-resources/location/location2.json +48 -0
  238. package/tests/common-resources/location/location3.json +48 -0
  239. package/tests/common-resources/location/location4.json +48 -0
  240. package/tests/common-resources/location/location5.json +48 -0
  241. package/tests/common-resources/location/location6.json +48 -0
  242. package/tests/common-resources/location/location7.json +48 -0
  243. package/tests/common-resources/location/location8.json +48 -0
  244. package/tests/common-resources/location/location9.json +48 -0
  245. package/tests/common-resources/locationRequest/locationRequest1.json +6 -0
  246. package/tests/common-resources/locationRequest/locationRequest2.json +32 -0
  247. package/tests/common-resources/locationRequest/locationRequest3.json +33 -0
  248. package/tests/common-resources/locationRequest/locationRequest4.json +31 -0
  249. package/tests/common-resources/locationStatus/locationStatus1.json +4 -0
  250. package/tests/common-resources/locationStatus/locationStatus10.json +4 -0
  251. package/tests/common-resources/locationStatus/locationStatus11.json +4 -0
  252. package/tests/common-resources/locationStatus/locationStatus12.json +4 -0
  253. package/tests/common-resources/locationStatus/locationStatus13.json +4 -0
  254. package/tests/common-resources/locationStatus/locationStatus2.json +4 -0
  255. package/tests/common-resources/locationStatus/locationStatus3.json +4 -0
  256. package/tests/common-resources/locationStatus/locationStatus4.json +4 -0
  257. package/tests/common-resources/locationStatus/locationStatus5.json +4 -0
  258. package/tests/common-resources/locationStatus/locationStatus6.json +4 -0
  259. package/tests/common-resources/locationStatus/locationStatus7.json +4 -0
  260. package/tests/common-resources/locationStatus/locationStatus8.json +4 -0
  261. package/tests/common-resources/locationStatus/locationStatus9.json +4 -0
  262. package/tests/common-resources/navigationProgress/navigationProgress1.json +77 -0
  263. package/tests/common-resources/navigationProgress/navigationProgress2.json +77 -0
  264. package/tests/common-resources/poi/poi1.json +35 -0
  265. package/tests/common-resources/poi/poi2.json +35 -0
  266. package/tests/common-resources/poi/poi3.json +35 -0
  267. package/tests/common-resources/poi/poi4.json +38 -0
  268. package/tests/common-resources/poi/poi5.json +35 -0
  269. package/tests/common-resources/poiCategory/poiCategory1.json +7 -0
  270. package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.json +1 -0
  271. package/tests/common-resources/poiCategoryIcon/poiCategoryIcon1.png +0 -0
  272. package/tests/common-resources/point/point1.json +14 -0
  273. package/tests/common-resources/point/point2.json +14 -0
  274. package/tests/common-resources/point/point3.json +14 -0
  275. package/tests/common-resources/point/point4.json +14 -0
  276. package/tests/common-resources/point/point5.json +14 -0
  277. package/tests/common-resources/point/point6.json +14 -0
  278. package/tests/common-resources/point/point7.json +14 -0
  279. package/tests/common-resources/point/point8.json +14 -0
  280. package/tests/common-resources/route/route1.json +530 -0
  281. package/tests/common-resources/routeStep/routeStep1.json +35 -0
  282. package/tests/common-resources/routeStep/routeStep2.json +35 -0
  283. package/tests/common-resources/routeStep/routeStep3.json +35 -0
  284. package/tests/common-resources/routeStep/routeStep4.json +35 -0
  285. package/tests/common-resources/routeStep/routeStep5.json +35 -0
  286. package/tests/common-resources/situmConversionArea/situmConversionArea1.json +19 -0
  287. package/tests/js/resources/fetchBuildings.json +176 -0
  288. package/tests/js/resources/fetchEventsFromBuilding.json +201 -0
  289. package/tests/js/resources/fetchFloorsFromBuilding.json +34 -0
  290. package/tests/js/resources/fetchIndoorPOIsFromBuilding.json +574 -0
  291. package/tests/js/resources/fetchMapFromFloor.json +3 -0
  292. package/tests/js/resources/fetchOutdoorPOIsFromBuilding.json +68 -0
  293. package/tests/js/resources/fetchPoiCategories.json +72 -0
  294. package/tests/js/resources/fetchPoiCategoryIconNormal.json +3 -0
  295. package/tests/js/resources/fetchPoiCategoryIconSelected.json +3 -0
  296. package/tests/js/resources/requestDirections.json +1167 -0
  297. package/tests/js/resources/startPositioning/0_starting.json +4 -0
  298. package/tests/js/resources/startPositioning/1_preparingPositioningModel.json +4 -0
  299. package/tests/js/resources/startPositioning/2_startingPositioning.json +4 -0
  300. package/tests/js/resources/startPositioning/3_calculating.json +4 -0
  301. package/tests/js/resources/startPositioning/4_position.json +48 -0
  302. package/tests/js/resources/startPositioning/5_position.json +48 -0
  303. package/tests/js/test.js +416 -0
  304. package/tests/scripts/clean_android_resources.sh +3 -0
  305. package/tests/scripts/clean_ios_resources.sh +3 -0
  306. package/tests/scripts/copy_android_resources.sh +3 -0
  307. package/tests/scripts/copy_ios_resources.sh +3 -0
  308. package/tests/scripts/self-destruct.sh +1 -0
  309. package/www/android/Interfaces.js +742 -0
  310. package/www/android/situm.js +296 -0
  311. package/www/ios/situm.js +99 -0
  312. package/www/map-view-controller.js +223 -0
  313. package/www/map-view.js +88 -0
@@ -0,0 +1,928 @@
1
+ //
2
+ // situmcordovapluginCreatorTests.m
3
+ // situmcordovapluginTests
4
+ //
5
+ // Created by Situm on 01/7/18.
6
+ // Copyright © 2018 Situm. All rights reserved.
7
+ //
8
+
9
+ #import "SitumCreatorTests.h"
10
+ #import "Constants.h"
11
+
12
+ @implementation SitumCreatorTests
13
+
14
+ //angle1.json
15
+ + (SITAngle *) createAngleFromDegrees {
16
+ SITAngle *angle = [[SITAngle alloc] initWithDegrees:47];
17
+ return angle;
18
+ }
19
+
20
+ //angle2.json
21
+ + (SITAngle *) createAngleFromRadians {
22
+ SITAngle *angle = [[SITAngle alloc] initWithRadians:1.4];
23
+ return angle;
24
+ }
25
+
26
+ //bounds1.json
27
+ + (SITBounds) createBoundsWithArray {
28
+ SITBounds Bounds;
29
+ Bounds.northWest = CLLocationCoordinate2DMake(2, 6);
30
+ Bounds.southWest = CLLocationCoordinate2DMake(2, 4);
31
+ Bounds.northEast = CLLocationCoordinate2DMake(6, 3);
32
+ Bounds.southEast = CLLocationCoordinate2DMake(5, 8);
33
+ return Bounds;
34
+ }
35
+
36
+ //bounds2.json
37
+ //NOTE: it is redundant in ios, it is equals to previous bounds1.json
38
+ + (SITBounds) createBounds {
39
+ SITBounds Bounds;
40
+ Bounds.northWest = CLLocationCoordinate2DMake(2, 6);
41
+ Bounds.southWest = CLLocationCoordinate2DMake(2, 4);
42
+ Bounds.northEast = CLLocationCoordinate2DMake(6, 3);
43
+ Bounds.southEast = CLLocationCoordinate2DMake(5, 8);
44
+ return Bounds;
45
+ }
46
+
47
+ //building1.json
48
+ + (SITBuilding *) createBuilding {
49
+ NSDictionary<NSString*, NSString*> *customFields = [[NSDictionary alloc] initWithObjectsAndKeys:
50
+ @"http://testUrl.com", @"notification_url",
51
+ @"1234", @"pin",
52
+ @"Trilateration", @"positioning-mode",
53
+ @"56C98FAD0C9, D5784F5A73CA", @"filter-beacon",
54
+ @"7f6cc424-aae2-47fd-b5e9-476ad15e4733, fa4b8d11-9c13-4ad9-9859-cecd41c58000, 1876b5fa-3e4b-4d09-9252-627032fe9312", @"beacons_uuids",
55
+ @"True", @"asset-localization",
56
+ nil] ;
57
+ CLLocationCoordinate2D center = CLLocationCoordinate2DMake(42.8723472943445, -8.56325268745422);
58
+ SITDimensions *dimensions = [[SITDimensions alloc] initWithWidth:71.0686153823893 height:42.6106416714803];
59
+ SITAngle *angle = [[SITAngle alloc] initWithRadians:-3.31881803875501];
60
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
61
+ [dateFormatter setDateFormat:kDateFormat];
62
+ NSDate *createdAt = [dateFormatter dateFromString:@"Wed Jan 04 18:41:43 +0000 2017"];
63
+ NSDate *updatedAt = [dateFormatter dateFromString:@"Wed Sep 12 12:10:25 +0000 2018"];
64
+
65
+ SITBuilding *building = [[SITBuilding alloc] initWithIdentifier:@"1051" createdAt:createdAt updatedAt:updatedAt customFields:customFields userIdentifier:@"-1" name:@"Ed. Emprendia - Situm" center:center info:@"<p>http://Prueba/actualizador/recibirAlarmas</p>" dimensions:dimensions rotation:angle pictureURL:nil pictureThumbURL:nil];
66
+ building.infoHTML = @"<p>http://Prueba/actualizador/recibirAlarmas</p>";
67
+ return building;
68
+ }
69
+
70
+ //cartesianCoordinate1.json
71
+ + (SITCartesianCoordinate *) createCartesianCoordinate {
72
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:5 y:7];
73
+ return cartesianCoordinate;
74
+ }
75
+
76
+ //coordinate1.json
77
+ + (CLLocationCoordinate2D) createCoordinate {
78
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(23, 43);
79
+ return coordinate;
80
+ }
81
+
82
+ //dimensions1.json
83
+ + (SITDimensions *) createDimensions {
84
+ SITDimensions *dimensions = [[SITDimensions alloc] initWithWidth:5 height:7];
85
+ return dimensions;
86
+ }
87
+
88
+ //event1.json
89
+ + (SITEvent *) createEvent {
90
+ SITEvent *event = [[SITEvent alloc] init];
91
+ event.identifier = [NSNumber numberWithDouble:12];
92
+ event.customFields = [[NSDictionary alloc] initWithObjectsAndKeys:@"en", @"lang", nil];
93
+ event.info = @"<p>Test html</p>";
94
+ event.project_identifier = @(1);
95
+ SITCircularArea *conversion = [SITCircularArea new];
96
+ CLLocationCoordinate2D conversionCenterCoordinate = CLLocationCoordinate2DMake(50, 100);
97
+ SITCartesianCoordinate *conversionCenterCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:5 y:10];
98
+ SITPoint *conversionCenterPoint = [[SITPoint alloc] initWithCoordinate:conversionCenterCoordinate buildingIdentifier:@"1" floorIdentifier:@"1000" cartesianCoordinate:conversionCenterCartesianCoordinate];
99
+ conversion.center = conversionCenterPoint;
100
+ conversion.radius = @(3);
101
+ event.conversion = conversion;
102
+ SITCircularArea *trigger = [SITCircularArea new];
103
+ CLLocationCoordinate2D triggerCenterCoordinate = CLLocationCoordinate2DMake(25, 50);
104
+ SITCartesianCoordinate *triggerCenterCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:2 y:5];
105
+ SITPoint *triggerCenterPoint = [[SITPoint alloc] initWithCoordinate:triggerCenterCoordinate buildingIdentifier:@"1" floorIdentifier:@"1000" cartesianCoordinate:triggerCenterCartesianCoordinate];
106
+ trigger.center = triggerCenterPoint;
107
+ trigger.radius = @(6);
108
+ event.trigger = trigger;
109
+ event.name = @"Event";
110
+ return event;
111
+ }
112
+
113
+ //floor1.json
114
+ + (SITFloor *) createFloorWithAltitude {
115
+ SITFloor *floor = [[SITFloor alloc] init];
116
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
117
+ [dateFormatter setDateFormat:kDateFormat];
118
+ floor.createdAt = [dateFormatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
119
+ floor.updatedAt = [dateFormatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
120
+ floor.altitude = 2.5;
121
+ floor.scale = 10.2;
122
+ floor.name = @"testName";
123
+ floor.mapURL = [[SITURL alloc] initWithDirection:@"TEST_URL"];
124
+ floor.level = 1;
125
+ floor.floor = 1;
126
+ floor.identifier = @"-1";
127
+ floor.buildingIdentifier = @"101";
128
+ return floor;
129
+ }
130
+
131
+ //floor2.json
132
+ + (SITFloor *) createFloorWithoutAltitude {
133
+ SITFloor *floor = [[SITFloor alloc] init];
134
+
135
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init];
136
+ [dateFormatter setDateFormat:kDateFormat];
137
+ floor.createdAt = [dateFormatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
138
+ floor.updatedAt = [dateFormatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
139
+ floor.name = @"testName";
140
+ floor.altitude = 0;
141
+ floor.scale = 10.2;
142
+ floor.mapURL = [[SITURL alloc] initWithDirection:@"TEST_URL"];
143
+ floor.level = 1;
144
+ floor.floor = 1;
145
+ floor.identifier = @"-1";
146
+ floor.buildingIdentifier = @"101";
147
+ return floor;
148
+ }
149
+
150
+ //indication1.json
151
+ + (SITIndication *) createIndication {
152
+ NSInteger stepIdxOrigin = 4;
153
+ NSInteger stepIdxDestination = 5;
154
+ float horizontalDistance = 5;
155
+ float orientationChange = 14.5;
156
+ float verticalDistance = 16;
157
+ NSNumber* nextLevel = nil;
158
+ kSITIndicationActions action = kSITGoAhead;
159
+ kSITIndicationOrientation orientation = kSITStraight;
160
+ SITIndication *indication = [[SITIndication alloc] initWithOriginStepIndex:stepIdxOrigin destinationStepIndex:stepIdxDestination action:action horizontalDistance:horizontalDistance orientation:orientation orientationChange:orientationChange verticalDistance:verticalDistance nextLevel:nextLevel];
161
+
162
+ return indication;
163
+ }
164
+
165
+ //locationRequest1.json
166
+ + (SITLocationRequest *) createLegacyLocationRequest {
167
+ SITLocationRequest *locationRequest = [[SITLocationRequest alloc] initWithBuildingId:@"1051"];
168
+ return locationRequest;
169
+ }
170
+
171
+ //locationRequest2.json
172
+ + (SITLocationRequest *) createLocationRequestWithoutGpsNorDeadReckoning {
173
+ SITLocationRequest *locationRequest = [[SITLocationRequest alloc] initWithBuildingId:@"1051"];
174
+ [locationRequest setUseDeadReckoning:false];
175
+ [locationRequest setUseGps:false];
176
+ [locationRequest setSmallestDisplacement:1.0];
177
+ [locationRequest setInterval:1000];
178
+ return locationRequest;
179
+ }
180
+
181
+ //locationRequest3.json
182
+ + (SITLocationRequest *) createLocationRequestWithGpsAndDeadReckoning {
183
+ SITLocationRequest *locationRequest = [[SITLocationRequest alloc] initWithBuildingId:@"1051"];
184
+ [locationRequest setUseDeadReckoning:true];
185
+ [locationRequest setUseGps:true];
186
+ [locationRequest setSmallestDisplacement:1.0];
187
+ [locationRequest setInterval:1000];
188
+ return locationRequest;
189
+ }
190
+
191
+ //locationRequest4.json
192
+ + (SITLocationRequest *) createLocationRequestWithBatterySaver {
193
+ SITLocationRequest *locationRequest = [[SITLocationRequest alloc] initWithBuildingId:@"1051"];
194
+ [locationRequest setUpdateInterval: kSITUpdateIntervalBatterySaver];
195
+ [locationRequest setSmallestDisplacement:1.0];
196
+ [locationRequest setInterval:1000];
197
+ return locationRequest;
198
+ }
199
+
200
+ //directionsRequest1.json
201
+ + (SITDirectionsRequest *) createDirectionsRequestWithPOI {
202
+ SITDirectionsRequest *directionsRequest = [[SITDirectionsRequest alloc] initWithLocation:[self createLocationWithBuildingAndCoordinate] withDestination:[self createPoiWithBuildingFloorAndCoordinates].position];
203
+ [directionsRequest setMinimizeFloorChanges:true];
204
+ [directionsRequest setAccessibility:kSITChooseShortest];
205
+ return directionsRequest;
206
+ }
207
+
208
+ + (SITDirectionsRequest *) createDirectionsRequestWithLocation {
209
+ SITDirectionsRequest *directionsRequest = [[SITDirectionsRequest alloc] initWithLocation:[self createLocationWithBuildingAndCoordinate] withDestination:[self locationWithCartesianBearing].position];
210
+ [directionsRequest setMinimizeFloorChanges:true];
211
+ [directionsRequest setAccessibility:kSITChooseShortest];
212
+ return directionsRequest;
213
+ }
214
+
215
+ + (SITDirectionsRequest *) createDirectionsRequestWithAccessible {
216
+ SITDirectionsRequest *directionsRequest = [[SITDirectionsRequest alloc] initWithLocation:[self createLocationWithBuildingAndCoordinate] withDestination:[self locationWithCartesianBearing].position];
217
+ [directionsRequest setMinimizeFloorChanges:true];
218
+ [directionsRequest setAccessible:true];
219
+ return directionsRequest;
220
+ }
221
+
222
+ //location1.json
223
+ + (SITLocation *) createLocationWithBuildingFloorAndCartesianCoordinates {
224
+ NSTimeInterval timestamp = 14676784;
225
+ //empty coordinate 0,0
226
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
227
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:45 y:46];
228
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
229
+ float bearing = 0; //degrees
230
+ float cartesianBearing = 0; //radians
231
+ kSITQualityValues quality = kSITHigh;
232
+ NSString *provider = @"TEST_PROVIDER";
233
+ float accuracy = 5;
234
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
235
+ location.bearingQuality = kSITLow;
236
+ return location;
237
+ }
238
+
239
+ //location2.json
240
+ + (SITLocation *) createLocationWithCoordinate {
241
+ NSTimeInterval timestamp = 14676784;
242
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(8.6, 10.5);
243
+ SITPoint *position = [[SITPoint alloc] initWihtCoordinate:coordinate];
244
+ position.buildingIdentifier = @"-1";
245
+ position.floorIdentifier = @"-1";
246
+ float bearing = 0; //degrees
247
+ float cartesianBearing = 0; //radians
248
+ kSITQualityValues quality = kSITHigh;
249
+ NSString *provider = @"TEST_PROVIDER";
250
+ float accuracy = 5;
251
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
252
+ location.bearingQuality = kSITHigh;
253
+ return location;
254
+ }
255
+
256
+ //location3.json
257
+ + (SITLocation *) createLocationWithBuildingAndCoordinate {
258
+ NSTimeInterval timestamp = 14676784;
259
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(8.6, 10.5);
260
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101"];
261
+ float bearing = 0; //degrees
262
+ float cartesianBearing = 0; //radians
263
+ kSITQualityValues quality = kSITHigh;
264
+ NSString *provider = @"TEST_PROVIDER";
265
+ float accuracy = 5;
266
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
267
+ location.bearingQuality = kSITHigh;
268
+ return location;
269
+ }
270
+
271
+ //location4.json
272
+ + (SITLocation *) locationWithCartesianBearing {
273
+ NSTimeInterval timestamp = 14676784;
274
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
275
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:45 y:46];
276
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
277
+ float bearing = 92; //degrees
278
+ float cartesianBearing = 2; //radians
279
+ kSITQualityValues quality = kSITHigh;
280
+ NSString *provider = @"TEST_PROVIDER";
281
+ float accuracy = 5;
282
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
283
+ location.bearingQuality = kSITHigh;
284
+ return location;
285
+ }
286
+
287
+ //location5.json
288
+ + (SITLocation *) locationWithoutCartesianBearing {
289
+ NSTimeInterval timestamp = 14676784;
290
+ //empty coordinate 0,0
291
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
292
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:45 y:46];
293
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
294
+ float bearing = 0; //degrees
295
+ float cartesianBearing = 0; //radians
296
+ kSITQualityValues quality = kSITHigh;
297
+ NSString *provider = @"TEST_PROVIDER";
298
+ float accuracy = 5;
299
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
300
+ location.bearingQuality = kSITLow;
301
+ return location;
302
+ }
303
+
304
+ //location6.json
305
+ + (SITLocation *) locationWithBearing {
306
+ NSTimeInterval timestamp = 14676784;
307
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(8.6, 10.5);
308
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1"];
309
+ float bearing = 92; //degrees
310
+ float cartesianBearing = 0; //radians
311
+ kSITQualityValues quality = kSITHigh;
312
+ NSString *provider = @"TEST_PROVIDER";
313
+ float accuracy = 5;
314
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
315
+ return location;
316
+ }
317
+
318
+ //location7.json
319
+ + (SITLocation *) locationWithouthBearing {
320
+ NSTimeInterval timestamp = 14676784;
321
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
322
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:45 y:46];
323
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
324
+ float bearing = 0; //degrees
325
+ float cartesianBearing = 0; //radians
326
+ kSITQualityValues quality = kSITHigh;
327
+ NSString *provider = @"TEST_PROVIDER";
328
+ float accuracy = 5;
329
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
330
+ location.bearingQuality = kSITLow;
331
+ return location;
332
+ }
333
+
334
+ //location8.json
335
+ + (SITLocation *) indoorLocationWithIndoorBearingQualityLow {
336
+ NSTimeInterval timestamp = 14676784;
337
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
338
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:45 y:46];
339
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
340
+ float bearing = 92; //degrees
341
+ float cartesianBearing = 2; //radians
342
+ kSITQualityValues quality = kSITHigh;
343
+ NSString *provider = @"TEST_PROVIDER";
344
+ float accuracy = 5;
345
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
346
+ location.bearingQuality = kSITLow;
347
+ return location;
348
+ }
349
+
350
+ //location9.json
351
+ + (SITLocation *) indoorLocationWithIndoorBearingQualityHigh {
352
+ NSTimeInterval timestamp = 14676784;
353
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
354
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:45 y:46];
355
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
356
+ float bearing = 92; //degrees
357
+ float cartesianBearing = 2; //radians
358
+ kSITQualityValues quality = kSITHigh;
359
+ NSString *provider = @"TEST_PROVIDER";
360
+ float accuracy = 5;
361
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
362
+ return location;
363
+ }
364
+
365
+ //location10.json
366
+ + (SITLocation *) outdoorLocation {
367
+ NSTimeInterval timestamp = 14676784;
368
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(8.6, 10.5);
369
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1"];
370
+ float bearing = 92; //degrees
371
+ float cartesianBearing = 0; //radians
372
+ kSITQualityValues quality = kSITHigh;
373
+ NSString *provider = @"TEST_PROVIDER";
374
+ float accuracy = 5;
375
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
376
+ return location;
377
+ }
378
+
379
+
380
+ //kSITLocationStopped,kSITLocationStarted not implemented in tests.
381
+ //0 default value for values not implemented in ios
382
+ //some methods bypassed returning default json values to pass tests
383
+
384
+ //locationStatus1.json
385
+ + (SITLocationState) createLocationStatusStarting {
386
+ return kSITLocationStarted;
387
+ }
388
+
389
+ //locationStatus3.json
390
+ + (SITLocationState) createLocationStatusCalculating {
391
+ return kSITLocationCalculating;
392
+ }
393
+
394
+ //locationStatus13.json
395
+ + (SITLocationState) createLocationStatusUserNotInBuilding {
396
+ return kSITLocationUserNotInBuilding;
397
+ }
398
+
399
+ //navigationProgress1.json
400
+ + (SITNavigationProgress *) createNavigationProgressOutdoor {
401
+ SITNavigationProgress *navigationProgress = [[SITNavigationProgress alloc] init];
402
+
403
+ //currentIndication
404
+ NSInteger currentStepIdxOrigin = 4;
405
+ NSInteger currentStepIdxDestination = 5;
406
+ float currentHorizontalDistance = 11.4;
407
+ float currentOrientationChange = 14.5;
408
+ float currentVerticalDistance = 15;
409
+ NSNumber* currentNextLevel = nil;
410
+ kSITIndicationActions currentAction = kSITTurn;
411
+ kSITIndicationOrientation currentOrientation = kSITBackward;
412
+ SITIndication *currentIndication = [[SITIndication alloc] initWithOriginStepIndex:currentStepIdxOrigin destinationStepIndex:currentStepIdxDestination action:currentAction horizontalDistance:currentHorizontalDistance orientation:currentOrientation orientationChange:currentOrientationChange verticalDistance:currentVerticalDistance nextLevel:currentNextLevel];
413
+ navigationProgress.currentIndication = currentIndication;
414
+
415
+ //nextIndication
416
+ NSInteger nextStepIdxOrigin = 4;
417
+ NSInteger nextStepIdxDestination = 5;
418
+ float nextHorizontalDistance = 8.6;
419
+ float nextOrientationChange = 3.5;
420
+ float nextVerticalDistance = 24;
421
+ NSNumber* nextNextLevel = nil;
422
+ kSITIndicationActions nextAction = kSITGoAhead;
423
+ kSITIndicationOrientation nextOrientation = kSITStraight;
424
+ SITIndication *nextIndication = [[SITIndication alloc] initWithOriginStepIndex:nextStepIdxOrigin destinationStepIndex:nextStepIdxDestination action:nextAction horizontalDistance:nextHorizontalDistance orientation:nextOrientation orientationChange:nextOrientationChange verticalDistance:nextVerticalDistance nextLevel:nextNextLevel];
425
+ navigationProgress.nextIndication = nextIndication;
426
+
427
+ navigationProgress.distanceToClosestPointInRoute = 12;
428
+ navigationProgress.currentStepIndex = 1;
429
+ navigationProgress.distanceToGoal = 24;
430
+ navigationProgress.distanceToEndStep = 16;
431
+ navigationProgress.timeToEndStep = 16;
432
+ navigationProgress.timeToGoal = 24;
433
+
434
+ //routeStep
435
+ //from
436
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(2, 5);
437
+ SITCartesianCoordinate *fromCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:0 y:0];
438
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"101" floorIdentifier:@"-1" cartesianCoordinate: fromCartesianCoordinate];
439
+ //to
440
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(3, 4);
441
+ SITCartesianCoordinate *toCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:0 y:0];
442
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"101" floorIdentifier:@"-1" cartesianCoordinate: toCartesianCoordinate];
443
+
444
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:1 from:from to:to isFirst:true isLast:false nextStepIndex:1 stepDistance:23.4 distanceToGoal:27];
445
+ navigationProgress.routeStep = routeStep;
446
+
447
+ //closestLocation
448
+ NSTimeInterval timestamp = 1242142142;
449
+ //empty coordinate 0,0
450
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(2, 4);
451
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:0 y:0];
452
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
453
+ float bearing = 0; //degrees
454
+ float cartesianBearing = 0; //radians
455
+ kSITQualityValues quality = kSITLow;
456
+ NSString *provider = @"TEST_PROVIDER";
457
+ float accuracy = 0;
458
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
459
+ navigationProgress.closestLocationInRoute = location;
460
+
461
+ return navigationProgress;
462
+ }
463
+
464
+ //navigationProgress2.json
465
+ + (SITNavigationProgress *) createNavigationProgressIndoor {
466
+ SITNavigationProgress *navigationProgress = [[SITNavigationProgress alloc] init];
467
+
468
+ //currentIndication
469
+ NSInteger currentStepIdxOrigin = 4;
470
+ NSInteger currentStepIdxDestination = 5;
471
+ float currentHorizontalDistance = 11.4;
472
+ float currentOrientationChange = 14.5;
473
+ float currentVerticalDistance = 15;
474
+ NSNumber* currentNextLevel = nil;
475
+ kSITIndicationActions currentAction = kSITTurn;
476
+ kSITIndicationOrientation currentOrientation = kSITBackward;
477
+ SITIndication *currentIndication = [[SITIndication alloc] initWithOriginStepIndex:currentStepIdxOrigin destinationStepIndex:currentStepIdxDestination action:currentAction horizontalDistance:currentHorizontalDistance orientation:currentOrientation orientationChange:currentOrientationChange verticalDistance:currentVerticalDistance nextLevel:currentNextLevel];
478
+ navigationProgress.currentIndication = currentIndication;
479
+
480
+ //nextIndication
481
+ NSInteger nextStepIdxOrigin = 4;
482
+ NSInteger nextStepIdxDestination = 5;
483
+ float nextHorizontalDistance = 8.6;
484
+ float nextOrientationChange = 3.5;
485
+ float nextVerticalDistance = 24;
486
+ NSNumber* nextNextLevel = nil;
487
+ kSITIndicationActions nextAction = kSITGoAhead;
488
+ kSITIndicationOrientation nextOrientation = kSITStraight;
489
+ SITIndication *nextIndication = [[SITIndication alloc] initWithOriginStepIndex:nextStepIdxOrigin destinationStepIndex:nextStepIdxDestination action:nextAction horizontalDistance:nextHorizontalDistance orientation:nextOrientation orientationChange:nextOrientationChange verticalDistance:nextVerticalDistance nextLevel:nextNextLevel];
490
+ navigationProgress.nextIndication = nextIndication;
491
+
492
+ navigationProgress.distanceToClosestPointInRoute = 12;
493
+ navigationProgress.currentStepIndex = 1;
494
+ navigationProgress.distanceToGoal = 24;
495
+ navigationProgress.distanceToEndStep = 16;
496
+ navigationProgress.timeToEndStep = 16;
497
+ navigationProgress.timeToGoal = 24;
498
+
499
+ //routeStep
500
+ //from
501
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(0, 0);
502
+ SITCartesianCoordinate *fromCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:5 y:6];
503
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinate];
504
+ //to
505
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(0, 0);
506
+ SITCartesianCoordinate *toCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:5];
507
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinate];
508
+
509
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:1 from:from to:to isFirst:true isLast:false nextStepIndex:1 stepDistance:23.4 distanceToGoal:27];
510
+ navigationProgress.routeStep = routeStep;
511
+
512
+ //closestLocation
513
+ NSTimeInterval timestamp = 1242142142;
514
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(2, 4);
515
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:2 y:5];
516
+ SITPoint *position = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
517
+ float bearing = 0; //degrees
518
+ float cartesianBearing = 0; //radians
519
+ kSITQualityValues quality = kSITLow;
520
+ NSString *provider = @"TEST_PROVIDER";
521
+ float accuracy = 0;
522
+ SITLocation *location = [[SITLocation alloc] initWithTimestamp:timestamp position:position bearing: bearing cartesianBearing:cartesianBearing quality:quality accuracy:accuracy provider:provider];
523
+ navigationProgress.closestLocationInRoute = location;
524
+
525
+ return navigationProgress;
526
+ }
527
+
528
+ //poi1.json
529
+ + (SITPOI *) createOutdoorPoiWithCategory {
530
+ SITPOICategory *category = [SITPOICategory new];
531
+ category.code = @"situm-no-category";
532
+ SITMultilanguageString *string = [[SITMultilanguageString alloc] initWithValue:@"Sin categoría" defaultLocale:[NSLocale localeWithLocaleIdentifier:@"es_ES"]];
533
+ category.name = string;
534
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(5, 2);
535
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101"];
536
+ NSDateFormatter *formatter = [NSDateFormatter new];
537
+ [formatter setDateFormat:kDateFormat];
538
+ NSDate *createdAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
539
+ NSDate *updatedAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
540
+
541
+ SITPOI *poi = [[SITPOI alloc] init];
542
+ [poi setValue:point
543
+ forKey:@"outdoorPosition"];
544
+ poi.category = category;
545
+ poi.infoHTML = @"TEST_INFO";
546
+ poi.name = @"TEST_NAME";
547
+ poi.identifier = @"-1";
548
+ poi.createdAt = createdAt;
549
+ poi.updatedAt = updatedAt;
550
+ poi.buildingIdentifier = @"101";
551
+ return poi;
552
+ }
553
+
554
+ //poi2.json
555
+ + (SITPOI *) createPoiWithBuildingFloorAndCoordinateWithCategory {
556
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:2 y:9];
557
+ SITBuilding *building = [[SITBuilding alloc] init];
558
+ building.identifier = @"101";
559
+ SITPoint *point = [[SITPoint alloc] initWithBuilding:building floorIdentifier:@"12" cartesianCoordinate:cartesianCoordinate];
560
+
561
+ SITPOICategory *category = [SITPOICategory new];
562
+ category.code = @"situm-no-category";
563
+ SITMultilanguageString *string = [[SITMultilanguageString alloc] initWithValue:@"Sin categoría" defaultLocale:[NSLocale localeWithLocaleIdentifier:@"es_ES"]];
564
+ category.name = string;
565
+
566
+ NSDateFormatter *formatter = [NSDateFormatter new];
567
+ [formatter setDateFormat:kDateFormat];
568
+ NSDate *createdAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
569
+ NSDate *updatedAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
570
+
571
+ SITPOI *poi = [SITPOI new];
572
+ [poi setValue:point
573
+ forKey:@"indoorPosition"];
574
+ poi.category = category;
575
+ poi.infoHTML = @"TEST_INFO";
576
+ poi.name = @"TEST_NAME";
577
+ poi.identifier = @"-1";
578
+ poi.createdAt = createdAt;
579
+ poi.updatedAt = updatedAt;
580
+ poi.buildingIdentifier = @"101";
581
+ return poi;
582
+ }
583
+
584
+ //poi3.json
585
+ + (SITPOI *) createPoiWithCoordinateAndBuildingId {
586
+ SITPOICategory *category = [SITPOICategory new];
587
+ category.code = @"situm-no-category";
588
+ SITMultilanguageString *string = [[SITMultilanguageString alloc] initWithValue:@"Sin categoría" defaultLocale:[NSLocale localeWithLocaleIdentifier:@"es_ES"]];
589
+ category.name = string;
590
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(5, 7);
591
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101"];
592
+
593
+ NSDateFormatter *formatter = [NSDateFormatter new];
594
+ [formatter setDateFormat:kDateFormat];
595
+ NSDate *createdAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
596
+ NSDate *updatedAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
597
+
598
+ SITPOI *poi = [[SITPOI alloc] init];
599
+ [poi setValue:point
600
+ forKey:@"outdoorPosition"];
601
+ poi.category = category;
602
+ poi.infoHTML = @"TEST_INFO";
603
+ poi.name = @"TEST_NAME";
604
+ poi.identifier = @"-1";
605
+ poi.createdAt = createdAt;
606
+ poi.updatedAt = updatedAt;
607
+ poi.buildingIdentifier = @"101";
608
+ return poi;
609
+ }
610
+
611
+ //poi4.json
612
+ + (SITPOI *) createPoiWithBuildingFloorCoordinateAndCartesian {
613
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:2 y:9];
614
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(37, 45);
615
+ SITBuilding *building = [[SITBuilding alloc] init];
616
+ building.identifier = @"101";
617
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate:cartesianCoordinate];
618
+
619
+ NSDateFormatter *formatter = [NSDateFormatter new];
620
+ [formatter setDateFormat:kDateFormat];
621
+ NSDate *createdAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
622
+ NSDate *updatedAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
623
+
624
+ SITPOICategory *category = [SITPOICategory new];
625
+ category.code = @"situm-no-category";
626
+ SITMultilanguageString *string = [[SITMultilanguageString alloc] initWithValue:@"Sin categoría" defaultLocale:[NSLocale localeWithLocaleIdentifier:@"es_ES"]];
627
+ category.name = string;
628
+
629
+ SITPOI *poi = [SITPOI new];
630
+ [poi setValue:point
631
+ forKey:@"indoorPosition"];
632
+ poi.category = category;
633
+ poi.infoHTML = @"TEST_INFO";
634
+ poi.name = @"TEST_NAME";
635
+ poi.identifier = @"-1";
636
+ poi.createdAt = createdAt;
637
+ poi.updatedAt = updatedAt;
638
+ poi.buildingIdentifier = @"101";
639
+ poi.customFields = [[NSDictionary alloc] initWithObjectsAndKeys:@"test", @"test_field", @"101", @"building", nil];
640
+ return poi;
641
+ }
642
+
643
+ //poi5.json
644
+ + (SITPOI *) createPoiWithBuildingFloorAndCoordinates {
645
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:2 y:9];
646
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(37.4534534534,54.65464564534);
647
+ SITBuilding *building = [[SITBuilding alloc] init];
648
+ building.identifier = @"101";
649
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate:cartesianCoordinate];
650
+
651
+ NSDateFormatter *formatter = [NSDateFormatter new];
652
+ [formatter setDateFormat:kDateFormat];
653
+ NSDate *createdAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
654
+ NSDate *updatedAt = [formatter dateFromString:@"Thu Jan 01 00:00:00 +0000 1970"];
655
+
656
+ SITPOICategory *category = [SITPOICategory new];
657
+ category.code = @"situm-no-category";
658
+ SITMultilanguageString *string = [[SITMultilanguageString alloc] initWithValue:@"Sin categoría" defaultLocale:[NSLocale localeWithLocaleIdentifier:@"es_ES"]];
659
+ category.name = string;
660
+
661
+ SITPOI *poi = [SITPOI new];
662
+ [poi setValue:point
663
+ forKey:@"indoorPosition"];
664
+ poi.category = category;
665
+ poi.infoHTML = @"TEST_INFO";
666
+ poi.name = @"TEST_NAME";
667
+ poi.createdAt = createdAt;
668
+ poi.updatedAt = updatedAt;
669
+ poi.buildingIdentifier = @"101";
670
+ poi.identifier = @"-1";
671
+ return poi;
672
+ }
673
+
674
+ //poiCategory1.json
675
+ + (SITPOICategory *) createPoiCategory {
676
+ SITPOICategory *category = [[SITPOICategory alloc] init];
677
+ category.name = [[SITMultilanguageString alloc] initWithValue:@"TEST_STRING" defaultLocale:[NSLocale currentLocale]];
678
+ category.code = @"TEST_CODE";
679
+ category.isPublic = true;
680
+ category.selectedIconURL = [[SITURL alloc] initWithDirection:@"TEST_URL"];
681
+ category.iconURL = [[SITURL alloc] initWithDirection:@"TEST_URL"];
682
+ return category;
683
+ }
684
+
685
+ + (UIImage *) createPoiCategoryIcon {
686
+ NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"poiCategoryIcon1"
687
+ ofType:@"png"
688
+ inDirectory:@"resources/poiCategoryIcon"];
689
+ UIImage *image = [UIImage imageWithContentsOfFile:filePath];
690
+ return image;
691
+ }
692
+
693
+ //point1.json
694
+ + (SITPoint *) createPointWithCoordinate {
695
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(3, 6);
696
+ SITPoint *point = [[SITPoint alloc] initWihtCoordinate:coordinate];
697
+ return point;
698
+ }
699
+
700
+ //point2.json
701
+ + (SITPoint *) createPointWithCoordinateAndBuildingId {
702
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(54, 64);
703
+ SITPoint * point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101"];
704
+ return point;
705
+ }
706
+
707
+ //point3.json
708
+ + (SITPoint *) createPointWithBuildingIdAndFloor {
709
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(0, 0);
710
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:5 y:7];
711
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
712
+ return point;
713
+ }
714
+
715
+ //point4.json
716
+ + (SITPoint *) createPointWithBuildingWithAngleFromDegrees {
717
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(12.3,14.0);
718
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
719
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
720
+ return point;
721
+ }
722
+
723
+ //point5.json
724
+ + (SITPoint *) createPointWithBuildingWithAngleFromRadians {
725
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(12.3,14.0);
726
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
727
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
728
+ return point;
729
+ }
730
+
731
+ //point6.json
732
+ + (SITPoint *) createPointWithBuildingWithAddress {
733
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(12.3,14.0);
734
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
735
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
736
+ return point;
737
+ }
738
+
739
+ //point7.json
740
+ + (SITPoint *) createPointWithBuildingWithInfo {
741
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(12.3,14.0);
742
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
743
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
744
+ return point;
745
+ }
746
+
747
+ //point8.json
748
+ + (SITPoint *) createPointWithBuildingWithPicture {
749
+ CLLocationCoordinate2D coordinate = CLLocationCoordinate2DMake(12.3,14.0);
750
+ SITCartesianCoordinate *cartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
751
+ SITPoint *point = [[SITPoint alloc] initWithCoordinate:coordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: cartesianCoordinate];
752
+ return point;
753
+ }
754
+
755
+ //route1.json
756
+ + (SITRoute *) createRouteBuildingWithDegreesPointWithCoordinates {
757
+
758
+ //from
759
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(12.3,14.0);
760
+ SITCartesianCoordinate *fromCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
761
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinate];
762
+ //to
763
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(12.3,14.0);
764
+ SITCartesianCoordinate *toCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:2 y:5];
765
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinate];
766
+
767
+ //routeSteps
768
+ //step1
769
+ CLLocationCoordinate2D fromCoordinateStep1 = CLLocationCoordinate2DMake(12.3,14.0);
770
+ SITCartesianCoordinate *fromCartesianCoordinateStep1 = [[SITCartesianCoordinate alloc] initWithX:4 y:7];
771
+ SITPoint *fromStep1 = [[SITPoint alloc] initWithCoordinate:fromCoordinateStep1 buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinateStep1];
772
+ CLLocationCoordinate2D toCoordinateStep1 = CLLocationCoordinate2DMake(12.3,14.0);
773
+ SITCartesianCoordinate *toCartesianCoordinateStep1 = [[SITCartesianCoordinate alloc] initWithX:6 y:6];
774
+ SITPoint *toStep1 = [[SITPoint alloc] initWithCoordinate:toCoordinateStep1 buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinateStep1];
775
+ SITRouteStep *step1 = [[SITRouteStep alloc] initWithIndex:1 from:fromStep1 to:toStep1 isFirst:true isLast:false nextStepIndex:2 stepDistance:11.4 distanceToGoal:27];
776
+
777
+ //step2
778
+ CLLocationCoordinate2D fromCoordinateStep2 = CLLocationCoordinate2DMake(12.3,14.0);
779
+ SITCartesianCoordinate *fromCartesianCoordinateStep2 = [[SITCartesianCoordinate alloc] initWithX:6 y:6];
780
+ SITPoint *fromStep2 = [[SITPoint alloc] initWithCoordinate:fromCoordinateStep2 buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinateStep2];
781
+ CLLocationCoordinate2D toCoordinateStep2 = CLLocationCoordinate2DMake(12.3,14.0);
782
+ SITCartesianCoordinate *toCartesianCoordinateStep2 = [[SITCartesianCoordinate alloc] initWithX:3 y:5];
783
+ SITPoint *toStep2 = [[SITPoint alloc] initWithCoordinate:toCoordinateStep2 buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinateStep2];
784
+ SITRouteStep *step2 = [[SITRouteStep alloc] initWithIndex:2 from:fromStep2 to:toStep2 isFirst:false isLast:false nextStepIndex:3 stepDistance:8.6 distanceToGoal:15.6];
785
+
786
+ //step3
787
+ CLLocationCoordinate2D fromCoordinateStep3 = CLLocationCoordinate2DMake(12.3,14.0);
788
+ SITCartesianCoordinate *fromCartesianCoordinateStep3 = [[SITCartesianCoordinate alloc] initWithX:3 y:5];
789
+ SITPoint *fromStep3 = [[SITPoint alloc] initWithCoordinate:fromCoordinateStep3 buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinateStep3];
790
+ CLLocationCoordinate2D toCoordinateStep3 = CLLocationCoordinate2DMake(2,5);
791
+ SITPoint *toStep3 = [[SITPoint alloc] initWithCoordinate:toCoordinateStep3 buildingIdentifier:@"101"];
792
+ SITRouteStep *step3 = [[SITRouteStep alloc] initWithIndex:3 from:fromStep3 to:toStep3 isFirst:false isLast:true nextStepIndex:3 stepDistance:7 distanceToGoal:7];
793
+
794
+ NSMutableArray *routeSteps = [[NSMutableArray alloc] init];
795
+ [routeSteps addObject:step1];
796
+ [routeSteps addObject:step2];
797
+ [routeSteps addObject:step3];
798
+
799
+
800
+
801
+ //indications
802
+ //indication1
803
+ NSInteger stepIdxOrigin1 = 4;
804
+ NSInteger stepIdxDestination1 = 5;
805
+ float horizontalDistance1 = 11.4;
806
+ float orientationChange1 = 14.5;
807
+ float verticalDistance1 = 15;
808
+ NSNumber* nextLevel1 = nil;
809
+ kSITIndicationActions action1 = kSITTurn;
810
+ kSITIndicationOrientation orientation1 = kSITBackward;
811
+ SITIndication *indication1 = [[SITIndication alloc] initWithOriginStepIndex:stepIdxOrigin1 destinationStepIndex:stepIdxDestination1 action:action1 horizontalDistance:horizontalDistance1 orientation:orientation1 orientationChange:orientationChange1 verticalDistance:verticalDistance1 nextLevel:nextLevel1];
812
+
813
+ //indication2
814
+ NSInteger stepIdxOrigin2 = 4;
815
+ NSInteger stepIdxDestination2 = 5;
816
+ float horizontalDistance2 = 8.6;
817
+ float orientationChange2 = 3.5;
818
+ float verticalDistance2 = 24;
819
+ NSNumber* nextLevel2 = nil;
820
+ kSITIndicationActions action2 = kSITGoAhead;
821
+ kSITIndicationOrientation orientation2 = kSITStraight;
822
+ SITIndication *indication2 = [[SITIndication alloc] initWithOriginStepIndex:stepIdxOrigin2 destinationStepIndex:stepIdxDestination2 action:action2 horizontalDistance:horizontalDistance2 orientation:orientation2 orientationChange:orientationChange2 verticalDistance:verticalDistance2 nextLevel:nextLevel2];
823
+
824
+ //indication3
825
+ NSInteger stepIdxOrigin3 = 4;
826
+ NSInteger stepIdxDestination3 = 5;
827
+ float horizontalDistance3 = 7;
828
+ float orientationChange3 = 3.5;
829
+ float verticalDistance3 = 30;
830
+ NSNumber* nextLevel3 = nil;
831
+ kSITIndicationActions action3 = kSITEnd;
832
+ kSITIndicationOrientation orientation3 = kSITLeft;
833
+ SITIndication *indication3 = [[SITIndication alloc] initWithOriginStepIndex:stepIdxOrigin3 destinationStepIndex:stepIdxDestination3 action:action3 horizontalDistance:horizontalDistance3 orientation:orientation3 orientationChange:orientationChange3 verticalDistance:verticalDistance3 nextLevel:nextLevel3];
834
+
835
+ NSMutableArray *indications = [[NSMutableArray alloc] init];
836
+ [indications addObject:indication1];
837
+ [indications addObject:indication2];
838
+ [indications addObject:indication3];
839
+
840
+ //options
841
+ NSMutableDictionary *options = [[NSMutableDictionary alloc] init];
842
+ SITRoute *route = [[SITRoute alloc] initWithOrigin:from destination:to routeSteps:routeSteps indications:indications distance:7 options:options];
843
+ return route;
844
+ }
845
+
846
+ //routeStep1.json
847
+ + (SITRouteStep *) createRouteStepWithCoordinate {
848
+ //from
849
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(2, 5);
850
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"-1"];
851
+ //to
852
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(3, 4);
853
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"-1"];
854
+
855
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:2 from:from to:to isFirst:false isLast:false nextStepIndex:3 stepDistance:23.4 distanceToGoal:27];
856
+ return routeStep;
857
+ }
858
+
859
+ //routeStep2.json
860
+ + (SITRouteStep *) createRouteStepWithCoordinateAndBuildingId {
861
+ //from
862
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(2, 5);
863
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"101"];
864
+ //to
865
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(3, 4);
866
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"101"];
867
+
868
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:2 from:from to:to isFirst:false isLast:false nextStepIndex:3 stepDistance:23.4 distanceToGoal:27];
869
+ return routeStep;
870
+ }
871
+
872
+ //routeStep3.json
873
+ + (SITRouteStep *) createRouteStepWithCoordinateBuildingIdAndFloor {
874
+ //from
875
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(0, 0);
876
+ SITCartesianCoordinate *fromCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:5];
877
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinate];
878
+ //to
879
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(0, 0);
880
+ SITCartesianCoordinate *toCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:4];
881
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"101" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinate];
882
+
883
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:2 from:from to:to isFirst:false isLast:false nextStepIndex:3 stepDistance:23.4 distanceToGoal:27];
884
+ return routeStep;
885
+ }
886
+
887
+ //routeStep4.json
888
+ + (SITRouteStep *) createRouteStepWithBuildingWithAngleFromDegree {
889
+ //from
890
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(12.3, 14);
891
+ SITCartesianCoordinate *fromCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:5];
892
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinate];
893
+ //to
894
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(12.3, 14);
895
+ SITCartesianCoordinate *toCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:4];
896
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinate];
897
+
898
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:2 from:from to:to isFirst:false isLast:false nextStepIndex:3 stepDistance:23.4 distanceToGoal:27];
899
+ return routeStep;
900
+ }
901
+
902
+ //routeStep5.json
903
+ + (SITRouteStep *) createRouteStepWithBuildingWithAngleFromRadians {
904
+ //from
905
+ CLLocationCoordinate2D fromCoordinate = CLLocationCoordinate2DMake(12.3, 14);
906
+ SITCartesianCoordinate *fromCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:5];
907
+ SITPoint *from = [[SITPoint alloc] initWithCoordinate:fromCoordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: fromCartesianCoordinate];
908
+ //to
909
+ CLLocationCoordinate2D toCoordinate = CLLocationCoordinate2DMake(12.3, 14);
910
+ SITCartesianCoordinate *toCartesianCoordinate = [[SITCartesianCoordinate alloc] initWithX:3 y:4];
911
+ SITPoint *to = [[SITPoint alloc] initWithCoordinate:toCoordinate buildingIdentifier:@"-1" floorIdentifier:@"12" cartesianCoordinate: toCartesianCoordinate];
912
+
913
+ SITRouteStep *routeStep = [[SITRouteStep alloc] initWithIndex:2 from:from to:to isFirst:false isLast:false nextStepIndex:3 stepDistance:23.4 distanceToGoal:27];
914
+ return routeStep;
915
+ }
916
+
917
+ //situmConversionArea1.json
918
+ + (SITRectangularArea *) createSitumConversionArea {
919
+ SITRectangularArea *ca = [[SITRectangularArea alloc] init];
920
+ ca.bottomLeft = [[SITIndoorPoint alloc] initWithX:[NSNumber numberWithInt:3] y:[NSNumber numberWithInt:4] level_identifier:[NSNumber numberWithInt:12]];
921
+ ca.bottomRight = [[SITIndoorPoint alloc] initWithX:[NSNumber numberWithInt:3] y:[NSNumber numberWithInt:6] level_identifier:[NSNumber numberWithInt:12]];
922
+ ca.topLeft = [[SITIndoorPoint alloc] initWithX:[NSNumber numberWithInt:5] y:[NSNumber numberWithInt:4] level_identifier:[NSNumber numberWithInt:12]];
923
+ ca.topRight = [[SITIndoorPoint alloc] initWithX:[NSNumber numberWithInt:5] y:[NSNumber numberWithInt:6] level_identifier:[NSNumber numberWithInt:12]];
924
+ return ca;
925
+ }
926
+
927
+ @end
928
+