@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,126 @@
1
+ package es.situm.plugin.poi;
2
+
3
+ import org.json.JSONObject;
4
+ import org.json.simple.parser.JSONParser;
5
+
6
+ import java.io.File;
7
+ import java.io.FileReader;
8
+ import java.util.HashMap;
9
+
10
+
11
+ import es.situm.sdk.model.cartography.Poi;
12
+ import es.situm.sdk.model.cartography.PoiCategory;
13
+ import es.situm.sdk.model.cartography.Point;
14
+ import es.situm.sdk.model.location.CartesianCoordinate;
15
+ import es.situm.sdk.model.location.Coordinate;
16
+
17
+ public class PoiCreator {
18
+
19
+ private final ClassLoader classLoader = getClass().getClassLoader();
20
+ private final JSONParser parser = new JSONParser();
21
+
22
+ public Poi createOutdoorPoiWithCategory() {
23
+ Coordinate coordinate = new Coordinate(5,2);
24
+ return new Poi.Builder("101", coordinate)
25
+ .category(PoiCategory.DEFAULT)
26
+ .infoHtml("TEST_INFO")
27
+ .name("TEST_NAME")
28
+ .build();
29
+ }
30
+
31
+ public Poi createPoiWithBuildingFloorAndCoordinateWithCategory() {
32
+ Point point = new Point( "101", "12", Coordinate.EMPTY, new CartesianCoordinate(2,9));
33
+ return new Poi.Builder(point)
34
+ .category(PoiCategory.DEFAULT)
35
+ .infoHtml("TEST_INFO")
36
+ .name("TEST_NAME")
37
+ .build();
38
+ }
39
+
40
+ public Poi createPoiWithCoordinateAndBuildingId() {
41
+ Point point = new Point("101", new Coordinate(5,7));
42
+ return new Poi.Builder(point)
43
+ .category(PoiCategory.DEFAULT)
44
+ .infoHtml("TEST_INFO")
45
+ .name("TEST_NAME")
46
+ .build();
47
+ }
48
+
49
+ public Poi createPoiWithBuildingFloorCoordinateAndCartesian() {
50
+ HashMap<String, String> customFields = new HashMap<>();
51
+ customFields.put("building", "101");
52
+ customFields.put("test_field","test");
53
+ Point point = new Point( "101", "12", new Coordinate(37,45), new CartesianCoordinate(2,9));
54
+ return new Poi.Builder(point)
55
+ .category(PoiCategory.DEFAULT)
56
+ .infoHtml("TEST_INFO")
57
+ .customFields(customFields)
58
+ .name("TEST_NAME")
59
+ .build();
60
+ }
61
+
62
+ public Poi createPoiWithBuildingFloorAndCoordinates() {
63
+ Coordinate coordinate = new Coordinate(37.4534534534,54.65464564534);
64
+ CartesianCoordinate cartesianCoordinate = new CartesianCoordinate(2,9);
65
+ return new Poi.Builder("101", "12", coordinate, cartesianCoordinate)
66
+ .category(PoiCategory.DEFAULT)
67
+ .infoHtml("TEST_INFO")
68
+ .name("TEST_NAME")
69
+ .build();
70
+ }
71
+
72
+ public JSONObject getPoi1() {
73
+ try {
74
+ java.net.URL resource = classLoader.getResource("poi/poi1.json");
75
+ File file = new File(resource.getFile());
76
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
77
+ }catch(Exception e){
78
+ System.err.println(e.getMessage());
79
+ return null;
80
+ }
81
+ }
82
+
83
+ public JSONObject getPoi2() {
84
+ try {
85
+ java.net.URL resource = classLoader.getResource("poi/poi2.json");
86
+ File file = new File(resource.getFile());
87
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
88
+ }catch(Exception e){
89
+ System.err.println(e.getMessage());
90
+ return null;
91
+ }
92
+ }
93
+
94
+ public JSONObject getPoi3() {
95
+ try {
96
+ java.net.URL resource = classLoader.getResource("poi/poi3.json");
97
+ File file = new File(resource.getFile());
98
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
99
+ }catch(Exception e){
100
+ System.err.println(e.getMessage());
101
+ return null;
102
+ }
103
+ }
104
+
105
+ public JSONObject getPoi4() {
106
+ try {
107
+ java.net.URL resource = classLoader.getResource("poi/poi4.json");
108
+ File file = new File(resource.getFile());
109
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
110
+ }catch(Exception e){
111
+ System.err.println(e.getMessage());
112
+ return null;
113
+ }
114
+ }
115
+
116
+ public JSONObject getPoi5() {
117
+ try {
118
+ java.net.URL resource = classLoader.getResource("poi/poi5.json");
119
+ File file = new File(resource.getFile());
120
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
121
+ }catch(Exception e){
122
+ System.err.println(e.getMessage());
123
+ return null;
124
+ }
125
+ }
126
+ }
@@ -0,0 +1,38 @@
1
+ package es.situm.plugin.poiCategory;
2
+
3
+ import org.json.JSONObject;
4
+ import org.json.simple.parser.JSONParser;
5
+
6
+ import java.io.File;
7
+ import java.io.FileReader;
8
+
9
+ import es.situm.sdk.model.I18nString;
10
+ import es.situm.sdk.model.URL;
11
+ import es.situm.sdk.model.cartography.PoiCategory;
12
+
13
+ public class PoiCategoryCreator {
14
+
15
+ private final ClassLoader classLoader = getClass().getClassLoader();
16
+ private final JSONParser parser = new JSONParser();
17
+
18
+ public PoiCategory createPoiCategory() {
19
+ return new PoiCategory.Builder()
20
+ .code("TEST_CODE")
21
+ .isPublic(true)
22
+ .selectedIcon(new URL("TEST_URL"))
23
+ .unselectedIcon(new URL("TEST_URL"))
24
+ .name(new I18nString.Builder("TEST_STRING").build())
25
+ .build();
26
+ }
27
+
28
+ public JSONObject getPoiCategory1(){
29
+ try{
30
+ java.net.URL resource = classLoader.getResource("poiCategory/poiCategory1.json");
31
+ File file = new File(resource.getFile());
32
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
33
+ }catch(Exception e){
34
+ System.err.println(e.getMessage());
35
+ return null;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,200 @@
1
+ package es.situm.plugin.point;
2
+
3
+ import org.json.JSONObject;
4
+ import org.json.simple.parser.JSONParser;
5
+
6
+ import java.io.File;
7
+ import java.io.FileReader;
8
+
9
+ import es.situm.sdk.model.URL;
10
+ import es.situm.sdk.model.cartography.Building;
11
+ import es.situm.sdk.model.cartography.Point;
12
+ import es.situm.sdk.model.location.Angle;
13
+ import es.situm.sdk.model.location.CartesianCoordinate;
14
+ import es.situm.sdk.model.location.Coordinate;
15
+ import es.situm.sdk.model.location.Dimensions;
16
+
17
+ public class PointCreator {
18
+
19
+ private final ClassLoader classLoader = getClass().getClassLoader();
20
+ private final JSONParser parser = new JSONParser();
21
+
22
+ public Point createPointWithCoordinate() {
23
+ return new Point(new Coordinate(3,6));
24
+ }
25
+
26
+ public Point createPointWithCoordinateAndBuildingId() {
27
+ return new Point("101" , new Coordinate(54,64));
28
+ }
29
+
30
+ public Point createPointWithBuildingIdAndFloor() {
31
+ Coordinate coordinate = Coordinate.EMPTY;
32
+ CartesianCoordinate cartesianCoordinate = new CartesianCoordinate(5,7);
33
+ return new Point("101", "12", coordinate, cartesianCoordinate);
34
+ }
35
+
36
+ public Point createPointWithBuildingWithAngleFromDegrees() {
37
+ Coordinate coordinate = new Coordinate(12.3,14.0);
38
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
39
+ Building building = new Building.Builder()
40
+ .address("TEST_BUILDING")
41
+ .center(coordinate)
42
+ .dimensions(dimensions)
43
+ .infoHtml("TEST_INFO")
44
+ .name("TEST_NAME")
45
+ .pictureThumbUrl(new URL("TEST_URL"))
46
+ .pictureUrl(new URL("TEST_URL"))
47
+ .rotation(Angle.fromDegrees(45))
48
+ .userIdentifier("TEST_USER")
49
+ .build();
50
+ return new Point(building, "12",new CartesianCoordinate(4,7));
51
+ }
52
+
53
+ public Point createPointWithBuildingWithAngleFromRadians() {
54
+ Coordinate coordinate = new Coordinate(12.3,14.0);
55
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
56
+ Building building = new Building.Builder()
57
+ .address("TEST_BUILDING")
58
+ .center(coordinate)
59
+ .dimensions(dimensions)
60
+ .infoHtml("TEST_INFO")
61
+ .name("TEST_NAME")
62
+ .pictureThumbUrl(new URL("TEST_URL"))
63
+ .pictureUrl(new URL("TEST_URL"))
64
+ .rotation(Angle.fromRadians(0.3))
65
+ .userIdentifier("TEST_USER")
66
+ .build();
67
+ return new Point(building, "12",new CartesianCoordinate(4,7));
68
+ }
69
+
70
+ public Point createPointWithBuildingWithAddress() {
71
+ Coordinate coordinate = new Coordinate(12.3,14.0);
72
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
73
+ Building building = new Building.Builder()
74
+ .center(coordinate)
75
+ .dimensions(dimensions)
76
+ .name("TEST_NAME")
77
+ .address("TEST_ADDRESS")
78
+ .rotation(Angle.fromRadians(0.3))
79
+ .userIdentifier("TEST_USER")
80
+ .build();
81
+ return new Point(building, "12",new CartesianCoordinate(4,7));
82
+ }
83
+
84
+ public Point createPointWithBuildingWithInfo() {
85
+ Coordinate coordinate = new Coordinate(12.3,14.0);
86
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
87
+ Building building = new Building.Builder()
88
+ .center(coordinate)
89
+ .dimensions(dimensions)
90
+ .name("TEST_NAME")
91
+ .rotation(Angle.fromRadians(0.3))
92
+ .userIdentifier("TEST_USER")
93
+ .infoHtml("TEST_INFO")
94
+ .build();
95
+ return new Point(building, "12",new CartesianCoordinate(4,7));
96
+ }
97
+
98
+ public Point createPointWithBuildingWithPicture() {
99
+ Coordinate coordinate = new Coordinate(12.3,14.0);
100
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
101
+ Building building = new Building.Builder()
102
+ .center(coordinate)
103
+ .dimensions(dimensions)
104
+ .name("TEST_NAME")
105
+ .rotation(Angle.fromRadians(0.3))
106
+ .userIdentifier("TEST_USER")
107
+ .pictureUrl(new URL("TEST_URL"))
108
+ .pictureThumbUrl(new URL("TEST_URL"))
109
+ .build();
110
+ return new Point(building, "12",new CartesianCoordinate(4,7));
111
+ }
112
+
113
+ public JSONObject getPoint1(){
114
+ try{
115
+ java.net.URL resource = classLoader.getResource("point/point1.json");
116
+ File file = new File(resource.getFile());
117
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
118
+ }catch(Exception e){
119
+ System.err.println(e.getMessage());
120
+ return null;
121
+ }
122
+ }
123
+
124
+ public JSONObject getPoint2(){
125
+ try{
126
+ java.net.URL resource = classLoader.getResource("point/point2.json");
127
+ File file = new File(resource.getFile());
128
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
129
+ }catch(Exception e){
130
+ System.err.println(e.getMessage());
131
+ return null;
132
+ }
133
+ }
134
+
135
+ public JSONObject getPoint3(){
136
+ try{
137
+ java.net.URL resource = classLoader.getResource("point/point3.json");
138
+ File file = new File(resource.getFile());
139
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
140
+ }catch(Exception e){
141
+ System.err.println(e.getMessage());
142
+ return null;
143
+ }
144
+ }
145
+
146
+ public JSONObject getPoint4(){
147
+ try{
148
+ java.net.URL resource = classLoader.getResource("point/point4.json");
149
+ File file = new File(resource.getFile());
150
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
151
+ }catch(Exception e){
152
+ System.err.println(e.getMessage());
153
+ return null;
154
+ }
155
+ }
156
+
157
+ public JSONObject getPoint5(){
158
+ try{
159
+ java.net.URL resource = classLoader.getResource("point/point5.json");
160
+ File file = new File(resource.getFile());
161
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
162
+ }catch(Exception e){
163
+ System.err.println(e.getMessage());
164
+ return null;
165
+ }
166
+ }
167
+
168
+ public JSONObject getPoint6(){
169
+ try{
170
+ java.net.URL resource = classLoader.getResource("point/point6.json");
171
+ File file = new File(resource.getFile());
172
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
173
+ }catch(Exception e){
174
+ System.err.println(e.getMessage());
175
+ return null;
176
+ }
177
+ }
178
+
179
+ public JSONObject getPoint7(){
180
+ try{
181
+ java.net.URL resource = classLoader.getResource("point/point7.json");
182
+ File file = new File(resource.getFile());
183
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
184
+ }catch(Exception e){
185
+ System.err.println(e.getMessage());
186
+ return null;
187
+ }
188
+ }
189
+
190
+ public JSONObject getPoint8(){
191
+ try{
192
+ java.net.URL resource = classLoader.getResource("point/point8.json");
193
+ File file = new File(resource.getFile());
194
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
195
+ }catch(Exception e){
196
+ System.err.println(e.getMessage());
197
+ return null;
198
+ }
199
+ }
200
+ }
@@ -0,0 +1,142 @@
1
+ package es.situm.plugin.route;
2
+
3
+ import org.json.JSONObject;
4
+ import org.json.simple.parser.JSONParser;
5
+
6
+ import java.io.File;
7
+ import java.io.FileReader;
8
+ import java.util.ArrayList;
9
+ import java.util.List;
10
+
11
+ import es.situm.sdk.directions.DirectionsRequest;
12
+ import es.situm.sdk.model.URL;
13
+ import es.situm.sdk.model.cartography.Building;
14
+ import es.situm.sdk.model.cartography.Floor;
15
+ import es.situm.sdk.model.cartography.Point;
16
+ import es.situm.sdk.model.directions.Indication;
17
+ import es.situm.sdk.model.directions.Route;
18
+ import es.situm.sdk.model.directions.RouteStep;
19
+ import es.situm.sdk.model.location.Angle;
20
+ import es.situm.sdk.model.location.CartesianCoordinate;
21
+ import es.situm.sdk.model.location.Coordinate;
22
+ import es.situm.sdk.model.location.Dimensions;
23
+
24
+ public class RouteCreator {
25
+
26
+ public final ClassLoader classLoader = getClass().getClassLoader();
27
+ public final JSONParser parser = new JSONParser();
28
+
29
+ public Route createRouteBuildingWithDegreesPointWithCoordinates() {
30
+ Coordinate coordinate = new Coordinate(12.3,14.0);
31
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
32
+ Building building = new Building.Builder()
33
+ .address("TEST_BUILDING")
34
+ .center(coordinate)
35
+ .dimensions(dimensions)
36
+ .infoHtml("TEST_INFO")
37
+ .name("TEST_NAME")
38
+ .pictureThumbUrl(new URL("TEST_URL"))
39
+ .pictureUrl(new URL("TEST_URL"))
40
+ .rotation(Angle.fromDegrees(45))
41
+ .userIdentifier("TEST_USER")
42
+ .build();
43
+ Point from = new Point(building, "12",new CartesianCoordinate(4,7));
44
+ Point to = new Point(building, "12",new CartesianCoordinate(2,5));
45
+ DirectionsRequest request = new DirectionsRequest.Builder()
46
+ .from(from, Angle.fromDegrees(30))
47
+ .isAccessible(true)
48
+ .to(to)
49
+ .build();
50
+ to = new Point(building, "12",new CartesianCoordinate(6,6));
51
+ RouteStep step1 = new RouteStep.Builder()
52
+ .distance(11.4)
53
+ .distanceToEnd(27)
54
+ .distanceToFloorChange(15.0)
55
+ .from(from)
56
+ .id(1)
57
+ .isLast(false)
58
+ .to(to)
59
+ .build();
60
+ from = new Point(building, "12",new CartesianCoordinate(6,6));
61
+ to = new Point(building, "12",new CartesianCoordinate(3,5));
62
+ RouteStep step2 = new RouteStep.Builder()
63
+ .distance(8.6)
64
+ .distanceToEnd(15.6)
65
+ .distanceToFloorChange(24.5)
66
+ .from(from)
67
+ .id(2)
68
+ .isLast(false)
69
+ .to(to)
70
+ .build();
71
+ from = new Point(building, "12",new CartesianCoordinate(3,5));
72
+ to = new Point("101", new Coordinate(2,5));
73
+ RouteStep step3 = new RouteStep.Builder()
74
+ .distance(7)
75
+ .distanceToEnd(7)
76
+ .distanceToFloorChange(30.0)
77
+ .from(from)
78
+ .id(3)
79
+ .isLast(true)
80
+ .to(to)
81
+ .build();
82
+ Indication indication = new Indication.Builder()
83
+ .setDistance(11.4)
84
+ .setDistanceToNextLevel(15)
85
+ .setInstructionType(Indication.Action.TURN)
86
+ .setNextLevel(null)
87
+ .setOrientation(14.5)
88
+ .setOrientationType(Indication.Orientation.BACKWARD)
89
+ .setStepIdxDestination(5)
90
+ .setStepIdxOrigin(4)
91
+ .build();
92
+ Indication indication2 = new Indication.Builder()
93
+ .setDistance(8.6)
94
+ .setDistanceToNextLevel(24)
95
+ .setInstructionType(Indication.Action.GO_AHEAD)
96
+ .setNextLevel(null)
97
+ .setOrientation(3.5)
98
+ .setOrientationType(Indication.Orientation.STRAIGHT)
99
+ .setStepIdxDestination(5)
100
+ .setStepIdxOrigin(4)
101
+ .build();
102
+ Indication indication3 = new Indication.Builder()
103
+ .setDistance(7)
104
+ .setDistanceToNextLevel(30)
105
+ .setInstructionType(Indication.Action.END)
106
+ .setNextLevel(null)
107
+ .setOrientation(3.5)
108
+ .setOrientationType(Indication.Orientation.LEFT)
109
+ .setStepIdxDestination(5)
110
+ .setStepIdxOrigin(4)
111
+ .build();
112
+ Floor floor = new Floor.Builder()
113
+ .buildingIdentifier("101")
114
+ .level(1)
115
+ .mapUrl(new URL("TEST_URL"))
116
+ .scale(10.2)
117
+ .build();
118
+ List<RouteStep> steps = new ArrayList<>();
119
+ List<Indication> indications = new ArrayList<>();
120
+ List<Floor> floors = new ArrayList<>();
121
+ steps.add(step1);
122
+ steps.add(step2);
123
+ steps.add(step3);
124
+ indications.add(indication);
125
+ indications.add(indication2);
126
+ indications.add(indication3);
127
+ floors.add(floor);
128
+ return new Route(request, steps, indications, building, floors);
129
+
130
+ }
131
+
132
+ public JSONObject getRoute1(){
133
+ try{
134
+ java.net.URL resource = classLoader.getResource("route/route1.json");
135
+ File file = new File(resource.getFile());
136
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
137
+ }catch(Exception e){
138
+ System.err.println(e.getMessage());
139
+ return null;
140
+ }
141
+ }
142
+ }
@@ -0,0 +1,173 @@
1
+ package es.situm.plugin.routeStep;
2
+
3
+ import org.json.JSONObject;
4
+ import org.json.simple.parser.JSONParser;
5
+
6
+ import java.io.File;
7
+ import java.io.FileReader;
8
+
9
+ import es.situm.sdk.model.URL;
10
+ import es.situm.sdk.model.cartography.Building;
11
+ import es.situm.sdk.model.cartography.Point;
12
+ import es.situm.sdk.model.directions.RouteStep;
13
+ import es.situm.sdk.model.location.Angle;
14
+ import es.situm.sdk.model.location.CartesianCoordinate;
15
+ import es.situm.sdk.model.location.Coordinate;
16
+ import es.situm.sdk.model.location.Dimensions;
17
+
18
+ public class RouteStepCreator {
19
+
20
+ private final ClassLoader classLoader = getClass().getClassLoader();
21
+ private final JSONParser parser = new JSONParser();
22
+
23
+ public RouteStep createRouteStepWithCoordinate() {
24
+ Point from = new Point(new Coordinate(2,5));
25
+ Point to = new Point(new Coordinate(3,4));
26
+ return new RouteStep.Builder()
27
+ .distance(23.4)
28
+ .distanceToEnd(27)
29
+ .distanceToFloorChange(13.6)
30
+ .from(from)
31
+ .id(2)
32
+ .isLast(false)
33
+ .to(to)
34
+ .build();
35
+ }
36
+
37
+ public RouteStep createRouteStepWithCoordinateAndBuildingId() {
38
+ Point from = new Point("101", new Coordinate(2,5));
39
+ Point to = new Point("101", new Coordinate(3,4));
40
+ return new RouteStep.Builder()
41
+ .distance(23.4)
42
+ .distanceToEnd(27)
43
+ .distanceToFloorChange(13.6)
44
+ .from(from)
45
+ .id(2)
46
+ .isLast(false)
47
+ .to(to)
48
+ .build();
49
+ }
50
+
51
+ public RouteStep createRouteStepWithCoordinateBuildingIdAndFloor() {
52
+ Point from = new Point("101", "12", Coordinate.EMPTY, new CartesianCoordinate(3,5));
53
+ Point to = new Point("101", "12", Coordinate.EMPTY, new CartesianCoordinate(3,4));
54
+ return new RouteStep.Builder()
55
+ .distance(23.4)
56
+ .distanceToEnd(27)
57
+ .distanceToFloorChange(13.6)
58
+ .from(from)
59
+ .id(2)
60
+ .isLast(false)
61
+ .to(to)
62
+ .build();
63
+ }
64
+
65
+ public RouteStep createRouteStepWithBuildingWithAngleFromDegree() {
66
+ Coordinate coordinate = new Coordinate(12.3,14.0);
67
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
68
+ Building building = new Building.Builder()
69
+ .address("TEST_BUILDING")
70
+ .center(coordinate)
71
+ .dimensions(dimensions)
72
+ .infoHtml("TEST_INFO")
73
+ .name("TEST_NAME")
74
+ .pictureThumbUrl(new URL("TEST_URL"))
75
+ .pictureUrl(new URL("TEST_URL"))
76
+ .rotation(Angle.fromDegrees(45))
77
+ .userIdentifier("TEST_USER")
78
+ .build();
79
+ Point from = new Point(building, "12", new CartesianCoordinate(3,5));
80
+ Point to = new Point(building, "12", new CartesianCoordinate(3,4));
81
+ return new RouteStep.Builder()
82
+ .distance(23.4)
83
+ .distanceToEnd(27)
84
+ .distanceToFloorChange(13.6)
85
+ .from(from)
86
+ .id(2)
87
+ .isLast(false)
88
+ .to(to)
89
+ .build();
90
+ }
91
+
92
+ public RouteStep createRouteStepWithBuildingWithAngleFromRadians() {
93
+ Coordinate coordinate = new Coordinate(12.3,14.0);
94
+ Dimensions dimensions = new Dimensions( 40.5,60.2);
95
+ Building building = new Building.Builder()
96
+ .address("TEST_BUILDING")
97
+ .center(coordinate)
98
+ .dimensions(dimensions)
99
+ .infoHtml("TEST_INFO")
100
+ .name("TEST_NAME")
101
+ .pictureThumbUrl(new URL("TEST_URL"))
102
+ .pictureUrl(new URL("TEST_URL"))
103
+ .rotation(Angle.fromRadians(0.4))
104
+ .userIdentifier("TEST_USER")
105
+ .build();
106
+ Point from = new Point(building, "12", new CartesianCoordinate(3,5));
107
+ Point to = new Point(building, "12", new CartesianCoordinate(3,4));
108
+ return new RouteStep.Builder()
109
+ .distance(23.4)
110
+ .distanceToEnd(27)
111
+ .distanceToFloorChange(13.6)
112
+ .from(from)
113
+ .id(2)
114
+ .isLast(false)
115
+ .to(to)
116
+ .build();
117
+ }
118
+
119
+ public JSONObject getRouteStep1(){
120
+ try{
121
+ java.net.URL resource = classLoader.getResource("routeStep/routeStep1.json");
122
+ File file = new File(resource.getFile());
123
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
124
+ }catch(Exception e){
125
+ System.err.println(e.getMessage());
126
+ return null;
127
+ }
128
+ }
129
+
130
+ public JSONObject getRouteStep2(){
131
+ try{
132
+ java.net.URL resource = classLoader.getResource("routeStep/routeStep2.json");
133
+ File file = new File(resource.getFile());
134
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
135
+ }catch(Exception e){
136
+ System.err.println(e.getMessage());
137
+ return null;
138
+ }
139
+ }
140
+
141
+ public JSONObject getRouteStep3(){
142
+ try{
143
+ java.net.URL resource = classLoader.getResource("routeStep/routeStep3.json");
144
+ File file = new File(resource.getFile());
145
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
146
+ }catch(Exception e){
147
+ System.err.println(e.getMessage());
148
+ return null;
149
+ }
150
+ }
151
+
152
+ public JSONObject getRouteStep4(){
153
+ try{
154
+ java.net.URL resource = classLoader.getResource("routeStep/routeStep4.json");
155
+ File file = new File(resource.getFile());
156
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
157
+ }catch(Exception e){
158
+ System.err.println(e.getMessage());
159
+ return null;
160
+ }
161
+ }
162
+
163
+ public JSONObject getRouteStep5(){
164
+ try{
165
+ java.net.URL resource = classLoader.getResource("routeStep/routeStep5.json");
166
+ File file = new File(resource.getFile());
167
+ return new JSONObject(parser.parse(new FileReader(file)).toString());
168
+ }catch(Exception e){
169
+ System.err.println(e.getMessage());
170
+ return null;
171
+ }
172
+ }
173
+ }