@hpcc-js/map 2.79.0 → 3.1.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 (298) hide show
  1. package/dist/index.js +888 -31380
  2. package/dist/index.js.map +7 -1
  3. package/package.json +41 -40
  4. package/src/CanvasPinLayer.ts +2 -2
  5. package/src/CanvasPins.ts +12 -11
  6. package/src/Choropleth.ts +13 -5
  7. package/src/ChoroplethContinents.ts +1 -1
  8. package/src/ChoroplethCounties.ts +9 -7
  9. package/src/ChoroplethCountries.ts +2 -2
  10. package/src/ChoroplethStates.ts +1 -2
  11. package/src/ChoroplethStatesHeat.ts +1 -1
  12. package/src/GMap.ts +4 -3
  13. package/src/GMapCounties.ts +2 -2
  14. package/src/GMapGraph.ts +1 -1
  15. package/src/GMapHeat.ts +1 -1
  16. package/src/GMapLayered.ts +2 -2
  17. package/src/GMapPin.ts +2 -2
  18. package/src/GMapPinLine.ts +38 -25
  19. package/src/GeoHash.ts +31 -17
  20. package/src/Graph.ts +1 -1
  21. package/src/Graticule.ts +14 -7
  22. package/src/Heat.ts +13 -8
  23. package/src/Layer.ts +28 -19
  24. package/src/Layered.ts +1 -1
  25. package/src/Lines.ts +6 -3
  26. package/src/OpenStreet.ts +7 -4
  27. package/src/Pins.ts +75 -44
  28. package/src/Projection.ts +1 -1
  29. package/src/TestHeatMap.ts +1 -1
  30. package/src/TopoJSONChoropleth.ts +106 -95
  31. package/src/__package__.ts +2 -2
  32. package/src/index.ts +29 -30
  33. package/src/leaflet/AlbersPR.ts +3 -3
  34. package/src/leaflet/Blank.ts +1 -1
  35. package/src/leaflet/Circles.ts +2 -2
  36. package/src/leaflet/ClusterCircles.ts +2 -2
  37. package/src/leaflet/Countries.ts +2 -2
  38. package/src/leaflet/DrawLayer.ts +2 -2
  39. package/src/leaflet/FeatureLayer.ts +3 -3
  40. package/src/leaflet/GMap.ts +3 -3
  41. package/src/leaflet/HeatLayer.ts +2 -2
  42. package/src/leaflet/Icons.ts +2 -2
  43. package/src/leaflet/Leaflet.ts +10 -9
  44. package/src/leaflet/MapBox.ts +2 -2
  45. package/src/leaflet/Markers.ts +2 -2
  46. package/src/leaflet/OpenStreet.ts +2 -2
  47. package/src/leaflet/Path.ts +3 -3
  48. package/src/leaflet/Pins.ts +2 -2
  49. package/src/leaflet/Polygons.ts +2 -2
  50. package/src/leaflet/Region.ts +2 -2
  51. package/src/leaflet/Text.ts +2 -2
  52. package/src/leaflet/TileLayer.ts +1 -1
  53. package/src/leaflet/TopoJSON.ts +3 -3
  54. package/src/leaflet/US.ts +2 -2
  55. package/src/leaflet/USCounties.ts +2 -2
  56. package/src/leaflet/USStates.ts +2 -2
  57. package/src/leaflet/World.ts +8 -7
  58. package/src/leaflet/index.ts +18 -18
  59. package/src/leaflet/leaflet-shim.ts +19 -0
  60. package/src/leaflet/plugins/BeautifyIcon.css +44 -0
  61. package/src/leaflet/plugins/BeautifyIcon.ts +190 -0
  62. package/src/leaflet/plugins/BeutifyIcon.licence +21 -0
  63. package/src/leaflet/plugins/D3SvgOverlay.css +3 -0
  64. package/src/leaflet/plugins/D3SvgOverlay.licence +21 -0
  65. package/src/leaflet/plugins/D3SvgOverlay.ts +175 -0
  66. package/src/leaflet/plugins/HeatLayer.license +22 -0
  67. package/src/leaflet/plugins/HeatLayer.ts +224 -0
  68. package/src/leaflet/plugins/Leaflet.GoogleMutant.ts +425 -0
  69. package/src/leaflet/plugins/lru_map.ts +352 -0
  70. package/types/CanvasPinLayer.d.ts +1 -2
  71. package/types/CanvasPins.d.ts +10 -12
  72. package/types/Choropleth.d.ts +6 -6
  73. package/types/ChoroplethContinents.d.ts +1 -2
  74. package/types/ChoroplethCounties.d.ts +6 -8
  75. package/types/ChoroplethCountries.d.ts +1 -3
  76. package/types/ChoroplethStates.d.ts +1 -3
  77. package/types/ChoroplethStatesHeat.d.ts +1 -2
  78. package/types/GMap.d.ts +3 -4
  79. package/types/GMapCounties.d.ts +2 -3
  80. package/types/GMapGraph.d.ts +1 -2
  81. package/types/GMapHeat.d.ts +1 -2
  82. package/types/GMapLayered.d.ts +1 -2
  83. package/types/GMapPin.d.ts +1 -2
  84. package/types/GMapPinLine.d.ts +35 -56
  85. package/types/GeoHash.d.ts +23 -34
  86. package/types/Graph.d.ts +1 -2
  87. package/types/Graticule.d.ts +12 -17
  88. package/types/Heat.d.ts +12 -17
  89. package/types/IChoropleth.d.ts +0 -1
  90. package/types/Layer.d.ts +26 -40
  91. package/types/Layered.d.ts +0 -1
  92. package/types/Lines.d.ts +5 -6
  93. package/types/OpenStreet.d.ts +6 -7
  94. package/types/Pins.d.ts +64 -103
  95. package/types/Projection.d.ts +0 -1
  96. package/types/TopoJSONChoropleth.d.ts +15 -4
  97. package/types/Utility.d.ts +0 -1
  98. package/types/__package__.d.ts +2 -3
  99. package/types/index.d.ts +29 -31
  100. package/types/leaflet/AlbersPR.d.ts +2 -3
  101. package/types/leaflet/Blank.d.ts +1 -2
  102. package/types/leaflet/Circles.d.ts +2 -3
  103. package/types/leaflet/ClusterCircles.d.ts +2 -3
  104. package/types/leaflet/Countries.d.ts +1 -2
  105. package/types/leaflet/DrawLayer.d.ts +2 -3
  106. package/types/leaflet/FeatureLayer.d.ts +3 -4
  107. package/types/leaflet/GMap.d.ts +2 -3
  108. package/types/leaflet/HeatLayer.d.ts +2 -3
  109. package/types/leaflet/Icons.d.ts +2 -3
  110. package/types/leaflet/Leaflet.d.ts +9 -9
  111. package/types/leaflet/MapBox.d.ts +2 -3
  112. package/types/leaflet/Markers.d.ts +2 -3
  113. package/types/leaflet/OpenStreet.d.ts +2 -3
  114. package/types/leaflet/Path.d.ts +2 -3
  115. package/types/leaflet/Pins.d.ts +2 -3
  116. package/types/leaflet/Polygons.d.ts +2 -3
  117. package/types/leaflet/Region.d.ts +1 -2
  118. package/types/leaflet/Text.d.ts +2 -3
  119. package/types/leaflet/TileLayer.d.ts +1 -2
  120. package/types/leaflet/TopoJSON.d.ts +2 -3
  121. package/types/leaflet/US.d.ts +2 -3
  122. package/types/leaflet/USCounties.d.ts +1 -2
  123. package/types/leaflet/USStates.d.ts +1 -2
  124. package/types/leaflet/World.d.ts +5 -8
  125. package/types/leaflet/index.d.ts +18 -19
  126. package/types/leaflet/leaflet-shim.d.ts +14 -0
  127. package/types/leaflet/plugins/BeautifyIcon.d.ts +2 -0
  128. package/types/leaflet/plugins/D3SvgOverlay.d.ts +36 -0
  129. package/types/leaflet/plugins/HeatLayer.d.ts +23 -0
  130. package/types/leaflet/plugins/Leaflet.GoogleMutant.d.ts +1 -0
  131. package/types/leaflet/plugins/lru_map.d.ts +33 -0
  132. package/TopoJSON/AT.json +0 -1
  133. package/TopoJSON/BE.json +0 -1
  134. package/TopoJSON/BG.json +0 -1
  135. package/TopoJSON/BR.json +0 -123
  136. package/TopoJSON/CHLI.json +0 -1
  137. package/TopoJSON/CY.json +0 -1
  138. package/TopoJSON/CZ.json +0 -1
  139. package/TopoJSON/DE.json +0 -1
  140. package/TopoJSON/DK.json +0 -1
  141. package/TopoJSON/EE.json +0 -1
  142. package/TopoJSON/ES.json +0 -1
  143. package/TopoJSON/FI.json +0 -1
  144. package/TopoJSON/FR.json +0 -1
  145. package/TopoJSON/GB.json +0 -1
  146. package/TopoJSON/GB_idx.json +0 -1
  147. package/TopoJSON/GE.json +0 -1
  148. package/TopoJSON/GR.json +0 -1
  149. package/TopoJSON/HR.json +0 -1
  150. package/TopoJSON/HU.json +0 -1
  151. package/TopoJSON/IE.json +0 -1
  152. package/TopoJSON/IE_idx.json +0 -1
  153. package/TopoJSON/IS.json +0 -1
  154. package/TopoJSON/IT.json +0 -1
  155. package/TopoJSON/KS.json +0 -1
  156. package/TopoJSON/LT.json +0 -1
  157. package/TopoJSON/LU.json +0 -1
  158. package/TopoJSON/LV.json +0 -1
  159. package/TopoJSON/MD.json +0 -1
  160. package/TopoJSON/MK.json +0 -1
  161. package/TopoJSON/MT.json +0 -1
  162. package/TopoJSON/ND.json +0 -1
  163. package/TopoJSON/ND_idx.json +0 -1
  164. package/TopoJSON/NL.json +0 -1
  165. package/TopoJSON/NO.json +0 -1
  166. package/TopoJSON/PL.json +0 -1
  167. package/TopoJSON/PT.json +0 -1
  168. package/TopoJSON/RO.json +0 -1
  169. package/TopoJSON/RS.json +0 -1
  170. package/TopoJSON/SE.json +0 -1
  171. package/TopoJSON/SI.json +0 -1
  172. package/TopoJSON/SK.json +0 -1
  173. package/TopoJSON/UA.json +0 -1
  174. package/TopoJSON/countries.json +0 -257
  175. package/TopoJSON/us-counties.json +0 -16550
  176. package/TopoJSON/us-states.json +0 -458
  177. package/dist/index.es6.js +0 -31436
  178. package/dist/index.es6.js.map +0 -1
  179. package/dist/index.min.js +0 -7
  180. package/dist/index.min.js.map +0 -1
  181. package/types/CanvasPinLayer.d.ts.map +0 -1
  182. package/types/CanvasPins.d.ts.map +0 -1
  183. package/types/Choropleth.d.ts.map +0 -1
  184. package/types/ChoroplethContinents.d.ts.map +0 -1
  185. package/types/ChoroplethCounties.d.ts.map +0 -1
  186. package/types/ChoroplethCountries.d.ts.map +0 -1
  187. package/types/ChoroplethStates.d.ts.map +0 -1
  188. package/types/ChoroplethStatesHeat.d.ts.map +0 -1
  189. package/types/GMap.d.ts.map +0 -1
  190. package/types/GMapCounties.d.ts.map +0 -1
  191. package/types/GMapGraph.d.ts.map +0 -1
  192. package/types/GMapHeat.d.ts.map +0 -1
  193. package/types/GMapLayered.d.ts.map +0 -1
  194. package/types/GMapPin.d.ts.map +0 -1
  195. package/types/GMapPinLine.d.ts.map +0 -1
  196. package/types/GeoHash.d.ts.map +0 -1
  197. package/types/Graph.d.ts.map +0 -1
  198. package/types/Graticule.d.ts.map +0 -1
  199. package/types/Heat.d.ts.map +0 -1
  200. package/types/IChoropleth.d.ts.map +0 -1
  201. package/types/Layer.d.ts.map +0 -1
  202. package/types/Layered.d.ts.map +0 -1
  203. package/types/Lines.d.ts.map +0 -1
  204. package/types/OpenStreet.d.ts.map +0 -1
  205. package/types/Pins.d.ts.map +0 -1
  206. package/types/Projection.d.ts.map +0 -1
  207. package/types/TestHeatMap.d.ts +0 -5
  208. package/types/TestHeatMap.d.ts.map +0 -1
  209. package/types/TopoJSONChoropleth.d.ts.map +0 -1
  210. package/types/Utility.d.ts.map +0 -1
  211. package/types/__package__.d.ts.map +0 -1
  212. package/types/index.d.ts.map +0 -1
  213. package/types/leaflet/AlbersPR.d.ts.map +0 -1
  214. package/types/leaflet/Blank.d.ts.map +0 -1
  215. package/types/leaflet/Circles.d.ts.map +0 -1
  216. package/types/leaflet/ClusterCircles.d.ts.map +0 -1
  217. package/types/leaflet/Countries.d.ts.map +0 -1
  218. package/types/leaflet/DrawLayer.d.ts.map +0 -1
  219. package/types/leaflet/FeatureLayer.d.ts.map +0 -1
  220. package/types/leaflet/GMap.d.ts.map +0 -1
  221. package/types/leaflet/HeatLayer.d.ts.map +0 -1
  222. package/types/leaflet/Icons.d.ts.map +0 -1
  223. package/types/leaflet/Leaflet.d.ts.map +0 -1
  224. package/types/leaflet/MapBox.d.ts.map +0 -1
  225. package/types/leaflet/Markers.d.ts.map +0 -1
  226. package/types/leaflet/OpenStreet.d.ts.map +0 -1
  227. package/types/leaflet/Path.d.ts.map +0 -1
  228. package/types/leaflet/Pins.d.ts.map +0 -1
  229. package/types/leaflet/Polygons.d.ts.map +0 -1
  230. package/types/leaflet/Region.d.ts.map +0 -1
  231. package/types/leaflet/Text.d.ts.map +0 -1
  232. package/types/leaflet/TileLayer.d.ts.map +0 -1
  233. package/types/leaflet/TopoJSON.d.ts.map +0 -1
  234. package/types/leaflet/US.d.ts.map +0 -1
  235. package/types/leaflet/USCounties.d.ts.map +0 -1
  236. package/types/leaflet/USStates.d.ts.map +0 -1
  237. package/types/leaflet/World.d.ts.map +0 -1
  238. package/types/leaflet/index.d.ts.map +0 -1
  239. package/types/test.d.ts +0 -24
  240. package/types/test.d.ts.map +0 -1
  241. package/types-3.4/CanvasPinLayer.d.ts +0 -23
  242. package/types-3.4/CanvasPins.d.ts +0 -72
  243. package/types-3.4/Choropleth.d.ts +0 -59
  244. package/types-3.4/ChoroplethContinents.d.ts +0 -6
  245. package/types-3.4/ChoroplethCounties.d.ts +0 -17
  246. package/types-3.4/ChoroplethCountries.d.ts +0 -12
  247. package/types-3.4/ChoroplethStates.d.ts +0 -12
  248. package/types-3.4/ChoroplethStatesHeat.d.ts +0 -5
  249. package/types-3.4/GMap.d.ts +0 -137
  250. package/types-3.4/GMapCounties.d.ts +0 -23
  251. package/types-3.4/GMapGraph.d.ts +0 -6
  252. package/types-3.4/GMapHeat.d.ts +0 -6
  253. package/types-3.4/GMapLayered.d.ts +0 -20
  254. package/types-3.4/GMapPin.d.ts +0 -33
  255. package/types-3.4/GMapPinLine.d.ts +0 -72
  256. package/types-3.4/GeoHash.d.ts +0 -48
  257. package/types-3.4/Graph.d.ts +0 -14
  258. package/types-3.4/Graticule.d.ts +0 -30
  259. package/types-3.4/Heat.d.ts +0 -28
  260. package/types-3.4/IChoropleth.d.ts +0 -2
  261. package/types-3.4/Layer.d.ts +0 -58
  262. package/types-3.4/Layered.d.ts +0 -47
  263. package/types-3.4/Lines.d.ts +0 -17
  264. package/types-3.4/OpenStreet.d.ts +0 -22
  265. package/types-3.4/Pins.d.ts +0 -122
  266. package/types-3.4/Projection.d.ts +0 -6
  267. package/types-3.4/TestHeatMap.d.ts +0 -5
  268. package/types-3.4/TopoJSONChoropleth.d.ts +0 -5
  269. package/types-3.4/Utility.d.ts +0 -80
  270. package/types-3.4/__package__.d.ts +0 -4
  271. package/types-3.4/index.d.ts +0 -32
  272. package/types-3.4/leaflet/AlbersPR.d.ts +0 -16
  273. package/types-3.4/leaflet/Blank.d.ts +0 -5
  274. package/types-3.4/leaflet/Circles.d.ts +0 -56
  275. package/types-3.4/leaflet/ClusterCircles.d.ts +0 -30
  276. package/types-3.4/leaflet/Countries.d.ts +0 -7
  277. package/types-3.4/leaflet/DrawLayer.d.ts +0 -40
  278. package/types-3.4/leaflet/FeatureLayer.d.ts +0 -40
  279. package/types-3.4/leaflet/GMap.d.ts +0 -14
  280. package/types-3.4/leaflet/HeatLayer.d.ts +0 -32
  281. package/types-3.4/leaflet/Icons.d.ts +0 -26
  282. package/types-3.4/leaflet/Leaflet.d.ts +0 -53
  283. package/types-3.4/leaflet/MapBox.d.ts +0 -9
  284. package/types-3.4/leaflet/Markers.d.ts +0 -38
  285. package/types-3.4/leaflet/OpenStreet.d.ts +0 -9
  286. package/types-3.4/leaflet/Path.d.ts +0 -43
  287. package/types-3.4/leaflet/Pins.d.ts +0 -32
  288. package/types-3.4/leaflet/Polygons.d.ts +0 -36
  289. package/types-3.4/leaflet/Region.d.ts +0 -15
  290. package/types-3.4/leaflet/Text.d.ts +0 -41
  291. package/types-3.4/leaflet/TileLayer.d.ts +0 -33
  292. package/types-3.4/leaflet/TopoJSON.d.ts +0 -14
  293. package/types-3.4/leaflet/US.d.ts +0 -7
  294. package/types-3.4/leaflet/USCounties.d.ts +0 -6
  295. package/types-3.4/leaflet/USStates.d.ts +0 -6
  296. package/types-3.4/leaflet/World.d.ts +0 -59
  297. package/types-3.4/leaflet/index.d.ts +0 -19
  298. package/types-3.4/test.d.ts +0 -24
@@ -1,8 +1,8 @@
1
1
  import * as _GoogleMapsLoader from "google-maps";
2
2
 
3
- import { GoogleMutant, Map } from "@hpcc-js/leaflet-shim";
4
- import { requireGoogleMap } from "../GMap";
5
- import { TileLayer } from "./TileLayer";
3
+ import { GoogleMutant, Map } from "./leaflet-shim.ts";
4
+ import { requireGoogleMap } from "../GMap.ts";
5
+ import { TileLayer } from "./TileLayer.ts";
6
6
 
7
7
  declare const window: any;
8
8
 
@@ -1,5 +1,5 @@
1
- import { HeatLayer as LHeatLayer, LatLngBounds, Map } from "@hpcc-js/leaflet-shim";
2
- import { FeatureLayer } from "./FeatureLayer";
1
+ import { LHeatLayer, LatLngBounds, Map } from "./leaflet-shim.ts";
2
+ import { FeatureLayer } from "./FeatureLayer.ts";
3
3
 
4
4
  export class HeatLayer extends FeatureLayer {
5
5
 
@@ -1,5 +1,5 @@
1
- import { Icon, Map } from "@hpcc-js/leaflet-shim";
2
- import { Markers } from "./Markers";
1
+ import { Icon, Map } from "./leaflet-shim.ts";
2
+ import { Markers } from "./Markers.ts";
3
3
 
4
4
  export class Icons extends Markers {
5
5
 
@@ -1,11 +1,11 @@
1
- import { Button, HTMLWidget, IconBar, publish, Spacer, Widget } from "@hpcc-js/common";
2
- import { LatLngBounds, Map } from "@hpcc-js/leaflet-shim";
3
- import { AlbersLayer } from "./AlbersPR";
4
- import { BlankLayer } from "./Blank";
5
- import { GMapLayer } from "./GMap";
6
- import { MapBoxLayer } from "./MapBox";
7
- import { OpenStreetLayer } from "./OpenStreet";
8
- import { ILayer, TileLayer } from "./TileLayer";
1
+ import { Button, HTMLWidget, IconBar, Spacer, Widget } from "@hpcc-js/common";
2
+ import { LatLngBounds, Map } from "./leaflet-shim.ts";
3
+ import { AlbersLayer } from "./AlbersPR.ts";
4
+ import { BlankLayer } from "./Blank.ts";
5
+ import { GMapLayer } from "./GMap.ts";
6
+ import { MapBoxLayer } from "./MapBox.ts";
7
+ import { OpenStreetLayer } from "./OpenStreet.ts";
8
+ import { ILayer, TileLayer } from "./TileLayer.ts";
9
9
 
10
10
  import "../../src/leaflet/Leaflet.css";
11
11
 
@@ -225,7 +225,8 @@ export interface Leaflet {
225
225
  defaultLong(_: number): this;
226
226
  defaultZoom(): number;
227
227
  defaultZoom(_: number): this;
228
- autoZoomToFit: publish<this, boolean>;
228
+ autoZoomToFit(): boolean;
229
+ autoZoomToFit(_: boolean): this;
229
230
  }
230
231
 
231
232
  Leaflet.prototype.publish("showToolbar", true, "boolean", "Show toolbar", undefined, { hidden: (w: Leaflet) => w.isLayer() });
@@ -1,5 +1,5 @@
1
- import { Map, TileLayer as LeafletTileLayer } from "@hpcc-js/leaflet-shim";
2
- import { TileLayer } from "./TileLayer";
1
+ import { Map, TileLayer as LeafletTileLayer } from "./leaflet-shim.ts";
2
+ import { TileLayer } from "./TileLayer.ts";
3
3
 
4
4
  declare const window: any;
5
5
 
@@ -1,5 +1,5 @@
1
- import { Map, Marker, point, Direction } from "@hpcc-js/leaflet-shim";
2
- import { ClusterLayer } from "./FeatureLayer";
1
+ import { Map, Marker, point, Direction } from "./leaflet-shim.ts";
2
+ import { ClusterLayer } from "./FeatureLayer.ts";
3
3
 
4
4
  export class Markers extends ClusterLayer {
5
5
 
@@ -1,5 +1,5 @@
1
- import { Map, TileLayer as LeafletTileLayer } from "@hpcc-js/leaflet-shim";
2
- import { TileLayer } from "./TileLayer";
1
+ import { Map, TileLayer as LeafletTileLayer } from "./leaflet-shim.ts";
2
+ import { TileLayer } from "./TileLayer.ts";
3
3
 
4
4
  export class OpenStreetLayer extends TileLayer {
5
5
 
@@ -1,7 +1,7 @@
1
- import { Map } from "@hpcc-js/leaflet-shim";
1
+ import { Map } from "./leaflet-shim.ts";
2
2
  import { geoPath as d3GeoPath } from "d3-geo";
3
- import { resolve } from "../Projection";
4
- import { D3SurfaceLayer } from "./FeatureLayer";
3
+ import { resolve } from "../Projection.ts";
4
+ import { D3SurfaceLayer } from "./FeatureLayer.ts";
5
5
 
6
6
  const projectionFactor = (1 << 12) / 2 / Math.PI;
7
7
 
@@ -1,5 +1,5 @@
1
- import { BeautifyIcon, Map } from "@hpcc-js/leaflet-shim";
2
- import { Markers } from "./Markers";
1
+ import { BeautifyIcon, Map } from "./leaflet-shim.ts";
2
+ import { Markers } from "./Markers.ts";
3
3
 
4
4
  export class Pins extends Markers {
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { extent as d3Extent, Palette } from "@hpcc-js/common";
2
- import { LeafletEvent, Map, Polygon } from "@hpcc-js/leaflet-shim";
3
- import { FeatureLayer } from "./FeatureLayer";
2
+ import { LeafletEvent, Map, Polygon } from "./leaflet-shim.ts";
3
+ import { FeatureLayer } from "./FeatureLayer.ts";
4
4
 
5
5
  function lngLat2LatLng(d: [number, number]): [number, number] {
6
6
  return [d[1], d[0]];
@@ -1,7 +1,7 @@
1
1
  import { json as d3Json } from "d3-request";
2
2
  import * as topojson from "topojson-client";
3
- import { topoJsonFolder } from "../Choropleth";
4
- import { World } from "./World";
3
+ import { topoJsonFolder } from "../Choropleth.ts";
4
+ import { World } from "./World.ts";
5
5
 
6
6
  const topo_indexes = {
7
7
  "GB": ["administrative_area_level_3", "administrative_area_level_2", "administrative_area_level_1"],
@@ -1,6 +1,6 @@
1
- import { BeautifyIcon, Map } from "@hpcc-js/leaflet-shim";
1
+ import { BeautifyIcon, Map } from "./leaflet-shim.ts";
2
2
  import { format as d3Format } from "d3-format";
3
- import { Markers } from "./Markers";
3
+ import { Markers } from "./Markers.ts";
4
4
 
5
5
  export class Text extends Markers {
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { Widget } from "@hpcc-js/common";
2
- import { CRS, FeatureGroup, LatLngBounds, LeafletEvent, Map } from "@hpcc-js/leaflet-shim";
2
+ import { CRS, FeatureGroup, LatLngBounds, LeafletEvent, Map } from "./leaflet-shim.ts";
3
3
 
4
4
  export interface ILayer {
5
5
 
@@ -1,8 +1,8 @@
1
- import { GeoJSON, Map } from "@hpcc-js/leaflet-shim";
1
+ import { GeoJSON, Map } from "./leaflet-shim.ts";
2
2
  import { json as d3Json } from "d3-request";
3
3
  import * as topojson from "topojson-client";
4
- import { topoJsonFolder } from "../Choropleth";
5
- import { FeatureLayer } from "./FeatureLayer";
4
+ import { topoJsonFolder } from "../Choropleth.ts";
5
+ import { FeatureLayer } from "./FeatureLayer.ts";
6
6
 
7
7
  export function fixDateLine(feature, layer) {
8
8
  const latlongs = layer.getLatLngs();
package/src/leaflet/US.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { LatLngBounds } from "@hpcc-js/leaflet-shim";
2
- import { World } from "./World";
1
+ import { LatLngBounds } from "./leaflet-shim.ts";
2
+ import { World } from "./World.ts";
3
3
 
4
4
  export class US extends World {
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { json as d3Json } from "d3-request";
2
2
  import * as topojson from "topojson-client";
3
- import { topoJsonFolder } from "../Choropleth";
4
- import { US } from "./US";
3
+ import { topoJsonFolder } from "../Choropleth.ts";
4
+ import { US } from "./US.ts";
5
5
 
6
6
  let usCounties = null;
7
7
  const usCountyNames = {};
@@ -1,7 +1,7 @@
1
1
  import { json as d3Json } from "d3-request";
2
2
  import * as topojson from "topojson-client";
3
- import { topoJsonFolder } from "../Choropleth";
4
- import { US } from "./US";
3
+ import { topoJsonFolder } from "../Choropleth.ts";
4
+ import { US } from "./US.ts";
5
5
 
6
6
  let usStates = null;
7
7
  const usStateNames = {};
@@ -1,15 +1,14 @@
1
1
  import { Palette, SVGGlowFilter, Utility } from "@hpcc-js/common";
2
- import { LatLngBounds, Map } from "@hpcc-js/leaflet-shim";
2
+ import { LatLngBounds, Map } from "./leaflet-shim.ts";
3
3
  import { select as d3Select } from "d3-selection";
4
- import { FeatureLayer } from "./FeatureLayer";
5
- import { TopoJSON } from "./TopoJSON";
4
+ import { FeatureLayer } from "./FeatureLayer.ts";
5
+ import { TopoJSON } from "./TopoJSON.ts";
6
6
 
7
7
  import "../../src/leaflet/World.css";
8
8
 
9
9
  export class World extends FeatureLayer {
10
10
 
11
11
  protected _features;
12
- protected _selection: Utility.SimpleSelection;
13
12
  _palette;
14
13
 
15
14
  protected _dataMap = {};
@@ -136,19 +135,18 @@ World.prototype._palette = Palette.rainbow("default");
136
135
  World.prototype.mixin(Utility.SimpleSelectionMixin);
137
136
 
138
137
  export interface World {
139
- autoScaleMode(): string;
140
- autoScaleMode(_: string): this;
141
- autoScaleMode_exists(): boolean;
142
138
  paletteID(): string;
143
139
  paletteID(_: string): this;
144
140
  paletteID_exists(): boolean;
145
141
  useClonedPalette(): boolean;
146
142
  useClonedPalette(_: boolean): this;
147
143
  useClonedPalette_exists(): boolean;
144
+
148
145
  opacity(): number;
149
146
  opacity(_: number): this;
150
147
  opacity_default(_: number): this;
151
148
  opacity_exists(): boolean;
149
+
152
150
  meshVisible(): boolean;
153
151
  meshVisible(_: boolean): this;
154
152
  meshVisible_exists(): boolean;
@@ -158,6 +156,9 @@ export interface World {
158
156
  meshStrokeWidth(): number;
159
157
  meshStrokeWidth(_: number): this;
160
158
  meshStrokeWidth_exists(): boolean;
159
+ internalOnly(): boolean;
160
+ internalOnly(_: boolean): this;
161
+ internalOnly_exists(): boolean;
161
162
  }
162
163
 
163
164
  World.prototype.publish("paletteID", "YlOrRd", "set", "Color palette for this widget", World.prototype._palette.switch(), { tags: ["Basic", "Shared"] });
@@ -1,18 +1,18 @@
1
- export * from "./Circles";
2
- export * from "./ClusterCircles";
3
- export * from "./Countries";
4
- export * from "./DrawLayer";
5
- export * from "./FeatureLayer";
6
- export * from "./HeatLayer";
7
- export * from "./Icons";
8
- export * from "./Leaflet";
9
- export * from "./Markers";
10
- export * from "./Polygons";
11
- export * from "./Path";
12
- export * from "./Pins";
13
- export * from "./Region";
14
- export * from "./Text";
15
- export * from "./TileLayer";
16
- export * from "./USCounties";
17
- export * from "./USStates";
18
- export * from "./World";
1
+ export * from "./Circles.ts";
2
+ export * from "./ClusterCircles.ts";
3
+ export * from "./Countries.ts";
4
+ export * from "./DrawLayer.ts";
5
+ export * from "./FeatureLayer.ts";
6
+ export * from "./HeatLayer.ts";
7
+ export * from "./Icons.ts";
8
+ export * from "./Leaflet.ts";
9
+ export * from "./Markers.ts";
10
+ export * from "./Polygons.ts";
11
+ export * from "./Path.ts";
12
+ export * from "./Pins.ts";
13
+ export * from "./Region.ts";
14
+ export * from "./Text.ts";
15
+ export * from "./TileLayer.ts";
16
+ export * from "./USCounties.ts";
17
+ export * from "./USStates.ts";
18
+ export * from "./World.ts";
@@ -0,0 +1,19 @@
1
+ import L, { Circle, Control, CRS, Direction, DivIcon, Draw, FeatureGroup, GeoJSON, Icon, LatLng, LatLngBounds, LatLngExpression, LeafletEvent, Map, Marker, point, Point, Polygon, Polyline, Rectangle, TileLayer, Transformation, Util } from "leaflet";
2
+
3
+ import "leaflet/dist/leaflet.css";
4
+
5
+ import "leaflet-draw";
6
+ import "leaflet-draw/dist/leaflet.draw.css";
7
+ import "leaflet.markercluster";
8
+ import "leaflet.markercluster/dist/MarkerCluster.css";
9
+ import "leaflet.markercluster/dist/MarkerCluster.Default.css";
10
+
11
+ export { GoogleMutant } from "./plugins/Leaflet.GoogleMutant.ts";
12
+ export { BeautifyIcon } from "./plugins/BeautifyIcon.ts";
13
+ export { D3SvgOverlay } from "./plugins/D3SvgOverlay.ts";
14
+ export { HeatLayer as LHeatLayer } from "./plugins/HeatLayer.ts";
15
+
16
+ export type MarkerClusterGroup = L.MarkerClusterGroup;
17
+ export const MarkerClusterGroup = L.MarkerClusterGroup;
18
+
19
+ export { L, Circle, Control, CRS, Direction, DivIcon, Draw, FeatureGroup, GeoJSON, Icon, LatLng, LatLngBounds, LatLngExpression, LeafletEvent, Map, Marker, point, Point, Polygon, Polyline, Rectangle, TileLayer, Transformation, Util };
@@ -0,0 +1,44 @@
1
+ /*
2
+ Leaflet.BeautifyIcon, a plugin that adds colorful iconic markers for Leaflet by giving full control of style to end user, It has also ability to adjust font awesome
3
+ and glyphicon icons
4
+ (c) 2016-2017, Muhammad Arslan Sajid
5
+ http://leafletjs.com
6
+ */
7
+ .beautify-marker {
8
+ text-align: center;
9
+ font-weight: 700;
10
+ font-family: monospace;
11
+ position:absolute;
12
+ -webkit-box-sizing: border-box;
13
+ -moz-box-sizing: border-box;
14
+ box-sizing: border-box;
15
+ }
16
+
17
+ .beautify-marker.selected > div {
18
+ outline: none;
19
+ border-color: red;
20
+ box-shadow: 0 0 10px red;
21
+ }
22
+
23
+ .beautify-marker.circle {
24
+ border-radius: 100%;
25
+ }
26
+
27
+ .beautify-marker.circle-dot, .beautify-marker.doughnut {
28
+ border-radius: 100%;
29
+ }
30
+
31
+ .beautify-marker.marker {
32
+ border-top-left-radius: 50%;
33
+ border-top-right-radius: 50% 100%;
34
+ border-bottom-left-radius: 100% 50%;
35
+ border-bottom-right-radius: 0%;
36
+ /* rotating 45deg clockwise to get the corner bottom center */
37
+ transform: rotate(45deg);
38
+
39
+ }
40
+
41
+ .beautify-marker.marker > * {
42
+ /* rotating 45deg counterclock to adjust marker content back to normal */
43
+ transform: rotate(-45deg);
44
+ }
@@ -0,0 +1,190 @@
1
+ import { Icon, point, Util } from "leaflet";
2
+
3
+ import "./BeautifyIcon.css";
4
+
5
+ /* Ported from https://github.com/marslan390/BeautifyMarker
6
+ Changes:
7
+ * Ported to TypeScript
8
+ * Added @hpcc-js "selection" support
9
+ */
10
+
11
+ const defaults = {
12
+
13
+ iconColor: "#1EB300",
14
+
15
+ iconAnchor: {
16
+ "marker": [14, 34]
17
+ , "circle": [11, 10]
18
+ , "circle-dot": [5, 5]
19
+ , "rectangle-dot": [5, 6]
20
+ , "doughnut": [8, 8]
21
+ },
22
+
23
+ popupAnchor: {
24
+ "marker": [0, -25]
25
+ , "circle": [-3, -76]
26
+ , "circle-dot": [0, -2]
27
+ , "rectangle-dot": [0, -2]
28
+ , "doughnut": [0, -2]
29
+ },
30
+
31
+ innerIconAnchor: {
32
+ marker: [-2, 5]
33
+ , circle: [0, 2]
34
+ },
35
+
36
+ iconSize: {
37
+ "marker": [28, 28]
38
+ , "circle": [22, 22]
39
+ , "circle-dot": [2, 2]
40
+ , "rectangle-dot": [2, 2]
41
+ , "doughnut": [15, 15]
42
+ }
43
+ };
44
+
45
+ const IconClass = Icon.extend({
46
+
47
+ options: {
48
+ icon: "leaf"
49
+ , iconSize: defaults.iconSize.circle
50
+ , iconAnchor: defaults.iconAnchor.marker
51
+ , iconShape: "marker"
52
+ , iconStyle: ""
53
+ , innerIconAnchor: [0, 3] // circle with fa or glyphicon or marker with text
54
+ , innerIconStyle: ""
55
+ , isAlphaNumericIcon: false
56
+ , text: 1
57
+ , borderColor: defaults.iconColor
58
+ , borderWidth: 2
59
+ , borderStyle: "solid"
60
+ , backgroundColor: "white"
61
+ , textColor: defaults.iconColor
62
+ , customClasses: ""
63
+ , spin: false
64
+ , prefix: "fa"
65
+ , html: ""
66
+ },
67
+
68
+ initialize(options) {
69
+
70
+ this.applyDefaults(options);
71
+ this.options = (!options || !options.html) ? Util.setOptions(this, options) : options;
72
+ },
73
+
74
+ applyDefaults(options) {
75
+
76
+ if (options) {
77
+ if (!options.iconSize && options.iconShape) {
78
+ options.iconSize = defaults.iconSize[options.iconShape];
79
+ }
80
+
81
+ if (!options.iconAnchor && options.iconShape) {
82
+ options.iconAnchor = defaults.iconAnchor[options.iconShape];
83
+ }
84
+
85
+ if (!options.popupAnchor && options.iconShape) {
86
+ options.popupAnchor = defaults.popupAnchor[options.iconShape];
87
+ }
88
+
89
+ if (!options.innerIconAnchor) {
90
+ // if icon is type of circle or marker
91
+ if (options.iconShape === "circle" || options.iconShape === "marker") {
92
+ if (options.iconShape === "circle" && options.isAlphaNumericIcon) { // if circle with text
93
+ options.innerIconAnchor = [0, -1];
94
+ } else if (options.iconShape === "marker" && !options.isAlphaNumericIcon) {// marker with icon
95
+ options.innerIconAnchor = defaults.innerIconAnchor[options.iconShape];
96
+ }
97
+ }
98
+ }
99
+ }
100
+ },
101
+
102
+ createIcon() {
103
+
104
+ const iconDiv = document.createElement("div");
105
+ const options = this.options;
106
+
107
+ iconDiv.innerHTML = !options.html ? this.createIconInnerHtml() : options.html;
108
+ this._setIconStyles(iconDiv);
109
+
110
+ // having a marker requires an extra parent div for rotation correction
111
+ if (this.options.iconShape === "marker") {
112
+ const wrapperDiv = document.createElement("div");
113
+ wrapperDiv.className = "beautify-marker" + (options.props.owner._currSelRow === options.props.row ? " selected" : "");
114
+ wrapperDiv.appendChild(iconDiv);
115
+ return wrapperDiv;
116
+ }
117
+
118
+ return iconDiv;
119
+ },
120
+
121
+ createIconInnerHtml() {
122
+
123
+ const options = this.options;
124
+
125
+ if (options.iconShape === "circle-dot" || options.iconShape === "rectangle-dot" || options.iconShape === "doughnut") {
126
+ return "";
127
+ }
128
+
129
+ const innerIconStyle = this.getInnerIconStyle(options);
130
+ if (options.isAlphaNumericIcon) {
131
+ return '<div style="' + innerIconStyle + '">' + options.text + "</div>";
132
+ }
133
+
134
+ let spinClass = "";
135
+ if (options.spin) {
136
+ spinClass = " fa-spin";
137
+ }
138
+
139
+ return '<i class="' + options.prefix + " " + options.icon + spinClass + '" style="' + innerIconStyle + '"></i>';
140
+ },
141
+
142
+ getInnerIconStyle(options) {
143
+
144
+ const innerAnchor = point(options.innerIconAnchor);
145
+ return "color:" + options.textColor + ";margin-top:" + innerAnchor.y + "px; margin-left:" + innerAnchor.x + "px;" + options.innerIconStyle;
146
+ },
147
+
148
+ _setIconStyles(iconDiv) {
149
+
150
+ const options = this.options;
151
+ const size = point(options.iconSize);
152
+ const anchor = point(options.iconAnchor);
153
+
154
+ iconDiv.className = "beautify-marker ";
155
+
156
+ if (options.iconShape) {
157
+ iconDiv.className += options.iconShape;
158
+ }
159
+
160
+ if (options.customClasses) {
161
+ iconDiv.className += " " + options.customClasses;
162
+ }
163
+
164
+ iconDiv.style.backgroundColor = options.backgroundColor;
165
+ iconDiv.style.color = options.textColor;
166
+ iconDiv.style.borderColor = options.borderColor;
167
+ iconDiv.style.borderWidth = options.borderWidth + "px";
168
+ iconDiv.style.borderStyle = options.borderStyle;
169
+
170
+ if (size) {
171
+ iconDiv.style.width = size.x + "px";
172
+ iconDiv.style.height = size.y + "px";
173
+ }
174
+
175
+ if (anchor) {
176
+ iconDiv.style.marginLeft = (-anchor.x) + "px";
177
+ iconDiv.style.marginTop = (-anchor.y) + "px";
178
+ }
179
+
180
+ if (options.iconStyle) {
181
+ let cStyle = iconDiv.getAttribute("style");
182
+ cStyle += options.iconStyle;
183
+ iconDiv.setAttribute("style", cStyle);
184
+ }
185
+ }
186
+ });
187
+
188
+ export function BeautifyIcon(options) {
189
+ return new (IconClass as any)(options);
190
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Muhammad Arslan Sajid
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ g.d3-overlay * {
2
+ pointer-events: visiblePainted;
3
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Teralytics AG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.