mapael-demo.js 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313
  1. $(function(){
  2. // Example #1
  3. $(".maparea1").mapael({
  4. map : {
  5. name : "france_departments"
  6. , width : 250
  7. }
  8. });
  9. // Example #2
  10. $(".maparea2").mapael({
  11. map : {
  12. name : "france_departments"
  13. , zoom: {
  14. enabled: true
  15. }
  16. , defaultPlot : {
  17. attrs : {
  18. opacity : 0.6
  19. }
  20. }
  21. },
  22. areas: {
  23. "department-56" : {
  24. text : {content : "56"},
  25. tooltip: {content : "Morbihan (56)"}
  26. }
  27. },
  28. plots : {
  29. 'paris' : {
  30. latitude : 48.86,
  31. longitude: 2.3444
  32. },
  33. 'lyon' : {
  34. type: "circle",
  35. size:50,
  36. latitude :45.758888888889,
  37. longitude: 4.8413888888889,
  38. value : 700000,
  39. href : "http://fr.wikipedia.org/wiki/Lyon",
  40. tooltip: {content : "<span style=\"font-weight:bold;\">City :</span> Lyon"},
  41. text : {content : "Lyon"}
  42. },
  43. 'rennes' : {
  44. type :"square",
  45. size :20,
  46. latitude : 48.114166666667,
  47. longitude: -1.6808333333333,
  48. tooltip: {content : "<span style=\"font-weight:bold;\">City :</span> Rennes"},
  49. text : {content : "Rennes"},
  50. href : "http://fr.wikipedia.org/wiki/Rennes"
  51. }
  52. }
  53. });
  54. $('#refreshmaparea2').on('click', function() {
  55. // Update some plots and areas attributes ...
  56. var updatedOptions = {'areas' : {}, 'plots' : {}};
  57. updatedOptions.areas["department-56"] = {
  58. tooltip : {
  59. content : "Morbihan (56) (2)"
  60. },
  61. attrs: {
  62. fill : "#0088db"
  63. },
  64. text : {content : "56 (2)"}
  65. };
  66. updatedOptions.plots["rennes"] = {
  67. tooltip : {
  68. content : "Rennes (2)"
  69. },
  70. attrs: {
  71. fill : "#f38a03"
  72. }
  73. , text : {position : "top"}
  74. , size : 5
  75. };
  76. // add some new plots ...
  77. var newPlots = {
  78. "Limoge" : {
  79. latitude : 45.834444,
  80. longitude : 1.261667,
  81. text : {content : "Limoge"},
  82. tooltip : {content : "Limoge"}
  83. }
  84. , "Dijon" : {
  85. size:60,
  86. latitude : 47.323056,
  87. longitude : 5.041944,
  88. text : {
  89. content : "Dijon",
  90. position : "left",
  91. margin : 5
  92. }
  93. }
  94. }
  95. // and delete some others ...
  96. var deletedPlots = ["paris", "lyon"];
  97. $(".maparea2").trigger('update', [updatedOptions, newPlots, deletedPlots, {animDuration : 1000}]);
  98. });
  99. // Example #3
  100. $(".maparea3").mapael({
  101. map : {
  102. name : "france_departments",
  103. zoom : {
  104. enabled : true
  105. },
  106. defaultArea: {
  107. attrs : {
  108. fill: "#5ba4ff",
  109. stroke: "#99c7ff",
  110. cursor: "pointer"
  111. },
  112. attrsHover : {
  113. animDuration:0
  114. },
  115. text : {
  116. attrs : {
  117. cursor: "pointer",
  118. "font-size" : 10,
  119. fill :"#000"
  120. },
  121. attrsHover : {
  122. animDuration : 0
  123. }
  124. },
  125. eventHandlers : {
  126. click: function(e, id, mapElem, textElem) {
  127. var newData = {'areas' : {}};
  128. if (mapElem.originalAttrs.fill == "#5ba4ff") {
  129. newData.areas[id] = {
  130. attrs : {
  131. fill : "#0088db"
  132. }
  133. };
  134. } else {
  135. newData.areas[id] = {
  136. attrs : {
  137. fill : "#5ba4ff"
  138. }
  139. };
  140. }
  141. $(".maparea3").trigger('update', [newData]);
  142. }
  143. }
  144. }
  145. },
  146. areas: {
  147. "department-29" : {
  148. text : {content : "dblclick", position : "top"},
  149. attrs : {
  150. fill :"#0088db"
  151. },
  152. tooltip: {content : "Finistère (29)"},
  153. eventHandlers : {
  154. click: function() {},
  155. dblclick: function(e, id, mapElem, textElem) {
  156. var newData = {'areas' : {}};
  157. if (mapElem.originalAttrs.fill == "#5ba4ff") {
  158. newData.areas[id] = {
  159. attrs : {
  160. fill : "#0088db"
  161. }
  162. };
  163. } else {
  164. newData.areas[id] = {
  165. attrs : {
  166. fill : "#5ba4ff"
  167. }
  168. };
  169. }
  170. $(".maparea3").trigger('update', [newData, false, false, 0]);
  171. }
  172. }
  173. }
  174. }
  175. });
  176. // Example #4
  177. $(".maparea4").mapael({
  178. map : {
  179. name : "france_departments",
  180. defaultArea: {
  181. attrs : {
  182. stroke : "#fff",
  183. "stroke-width" : 1
  184. },
  185. attrsHover : {
  186. "stroke-width" : 2
  187. }
  188. }
  189. },
  190. legend : {
  191. area : {
  192. display : true,
  193. title :"Population of France by department",
  194. labelAttrs : {title : "Hide the matching departments"},
  195. slices : [
  196. {
  197. max :300000,
  198. attrs : {
  199. fill : "#97e766"
  200. },
  201. label :"Less than de 300 000 inhabitants"
  202. },
  203. {
  204. min :300000,
  205. max :500000,
  206. attrs : {
  207. fill : "#7fd34d"
  208. },
  209. label :"Between 100 000 and 500 000 inhabitants"
  210. },
  211. {
  212. min :500000,
  213. max :1000000,
  214. attrs : {
  215. fill : "#5faa32"
  216. },
  217. label :"Between 500 000 and 1 000 000 inhabitants"
  218. },
  219. {
  220. min :1000000,
  221. attrs : {
  222. fill : "#3f7d1a"
  223. },
  224. label :"More than 1 million inhabitants"
  225. }
  226. ]
  227. }
  228. },
  229. areas: {
  230. "department-59": {
  231. value: "2617939",
  232. href : "#",
  233. tooltip: {content : "<span style=\"font-weight:bold;\">Nord (59)</span><br />Population : 2617939"}
  234. },
  235. "department-75": {
  236. value: "2268265",
  237. href : "#",
  238. tooltip: {content : "<span style=\"font-weight:bold;\">Paris (75)</span><br />Population : 2268265"}
  239. },
  240. "department-13": {
  241. value: "2000550",
  242. href : "#",
  243. tooltip: {content : "<span style=\"font-weight:bold;\">Bouches-du-Rhône (13)</span><br />Population : 2000550"}
  244. },
  245. "department-69": {
  246. value: "1756069",
  247. href : "#",
  248. tooltip: {content : "<span style=\"font-weight:bold;\">Rhône (69)</span><br />Population : 1756069"}
  249. },
  250. "department-92": {
  251. value: "1590749",
  252. href : "#",
  253. tooltip: {content : "<span style=\"font-weight:bold;\">Hauts-de-Seine (92)</span><br />Population : 1590749"}
  254. },
  255. "department-93": {
  256. value: "1534895",
  257. href : "#",
  258. tooltip: {content : "<span style=\"font-weight:bold;\">Seine-Saint-Denis (93)</span><br />Population : 1534895"}
  259. },
  260. "department-62": {
  261. value: "1489209",
  262. href : "#",
  263. tooltip: {content : "<span style=\"font-weight:bold;\">Pas-de-Calais (62)</span><br />Population : 1489209"}
  264. },
  265. "department-33": {
  266. value: "1479277",
  267. href : "#",
  268. tooltip: {content : "<span style=\"font-weight:bold;\">Gironde (33)</span><br />Population : 1479277"}
  269. },
  270. "department-82": {
  271. value: "248227",
  272. href : "#",
  273. tooltip: {content : "<span style=\"font-weight:bold;\">Tarn-et-Garonne (82)</span><br />Population : 248227"}
  274. },
  275. "department-70": {
  276. value: "247311",
  277. href : "#",
  278. tooltip: {content : "<span style=\"font-weight:bold;\">Haute-Saône (70)</span><br />Population : 247311"}
  279. },
  280. "department-36": {
  281. value: "238261",
  282. href : "#",
  283. tooltip: {content : "<span style=\"font-weight:bold;\">Indre (36)</span><br />Population : 238261"}
  284. },
  285. "department-65": {
  286. value: "237945",
  287. href : "#",
  288. tooltip: {content : "<span style=\"font-weight:bold;\">Hautes-Pyrénées (65)</span><br />Population : 237945"}
  289. },
  290. "department-43": {
  291. value: "231877",
  292. href : "#",
  293. tooltip: {content : "<span style=\"font-weight:bold;\">Haute-Loire (43)</span><br />Population : 231877"}
  294. },
  295. "department-973": {
  296. value: "231167",
  297. href : "#",
  298. tooltip: {content : "<span style=\"font-weight:bold;\">Guyane (973)</span><br />Population : 231167"}
  299. },
  300. "department-58": {
  301. value: "226997",
  302. href : "#",
  303. tooltip: {content : "<span style=\"font-weight:bold;\">Nièvre (58)</span><br />Population : 226997"}
  304. },
  305. "department-55": {
  306. value: "200509",
  307. href : "#",
  308. tooltip: {content : "<span style=\"font-weight:bold;\">Meuse (55)</span><br />Population : 200509"}
  309. },
  310. "department-32": {
  311. value: "195489",
  312. href : "#",
  313. tooltip: {content : "<span style=\"font-weight:bold;\">Gers (32)</span><br />Population : 195489"}
  314. },
  315. "department-52": {
  316. value: "191004",
  317. href : "#",
  318. tooltip: {content : "<span style=\"font-weight:bold;\">Haute-Marne (52)</span><br />Population : 191004"}
  319. },
  320. "department-46": {
  321. value: "181232",
  322. href : "#",
  323. tooltip: {content : "<span style=\"font-weight:bold;\">Lot (46)</span><br />Population : 181232"}
  324. },
  325. "department-2B": {
  326. value: "168869",
  327. href : "#",
  328. tooltip: {content : "<span style=\"font-weight:bold;\">Haute-Corse (2B)</span><br />Population : 168869"}
  329. },
  330. "department-04": {
  331. value: "165155",
  332. href : "#",
  333. tooltip: {content : "<span style=\"font-weight:bold;\">Alpes-de-Haute-Provence (04)</span><br />Population : 165155"}
  334. },
  335. "department-09": {
  336. value: "157582",
  337. href : "#",
  338. tooltip: {content : "<span style=\"font-weight:bold;\">Ariège (09)</span><br />Population : 157582"}
  339. },
  340. "department-15": {
  341. value: "154135",
  342. href : "#",
  343. tooltip: {content : "<span style=\"font-weight:bold;\">Cantal (15)</span><br />Population : 154135"}
  344. },
  345. "department-90": {
  346. value: "146475",
  347. href : "#",
  348. tooltip: {content : "<span style=\"font-weight:bold;\">Territoire de Belfort (90)</span><br />Population : 146475"}
  349. },
  350. "department-2A": {
  351. value: "145998",
  352. href : "#",
  353. tooltip: {content : "<span style=\"font-weight:bold;\">Corse-du-Sud (2A)</span><br />Population : 145998"}
  354. },
  355. "department-05": {
  356. value: "142312",
  357. href : "#",
  358. tooltip: {content : "<span style=\"font-weight:bold;\">Hautes-Alpes (05)</span><br />Population : 142312"}
  359. },
  360. "department-23": {
  361. value: "127919",
  362. href : "#",
  363. tooltip: {content : "<span style=\"font-weight:bold;\">Creuse (23)</span><br />Population : 127919"}
  364. },
  365. "department-48": {
  366. value: "81281",
  367. href : "#",
  368. tooltip: {content : "<span style=\"font-weight:bold;\">Lozère (48)</span><br />Population : 81281"}
  369. }
  370. }
  371. });
  372. // Example #5
  373. $(".maparea5").mapael({
  374. map : {
  375. name : "france_departments",
  376. defaultPlot: {
  377. size: 10
  378. },
  379. defaultArea : {
  380. attrsHover: {
  381. fill: "#343434"
  382. , stroke: "#5d5d5d"
  383. , "stroke-width": 1
  384. , "stroke-linejoin": "round"
  385. }
  386. }
  387. },
  388. legend : {
  389. plot :{
  390. display : true,
  391. cssClass: 'cityFrance'
  392. , labelAttrs: {
  393. fill: "#fff"
  394. }
  395. , titleAttrs: {
  396. fill: "#fff"
  397. }
  398. , marginBottom: 20
  399. , marginLeft : 30
  400. , hideElemsOnClick : {
  401. opacity : 0
  402. }
  403. , title: "Population of France by city"
  404. , slices : [
  405. {
  406. size: 4,
  407. type :"circle",
  408. max :20000,
  409. attrs : {
  410. fill : "#89ff72"
  411. },
  412. label :"Less than 20000 inhabitants"
  413. },
  414. {
  415. size: 6,
  416. type :"circle",
  417. min :20000,
  418. max :100000,
  419. attrs : {
  420. fill : "#fffd72"
  421. },
  422. label :"Between 20000 and 100000 inhabitants"
  423. },
  424. {
  425. size: 20,
  426. type :"circle",
  427. min :100000,
  428. max :200000,
  429. attrs : {
  430. fill : "#ffbd54"
  431. },
  432. label :"Between 100000 et 200000 inhabitants"
  433. },
  434. {
  435. size: 40,
  436. type :"circle",
  437. min :200000,
  438. attrs : {
  439. fill : "#ff5454"
  440. },
  441. label :"More than 200000 inhabitants"
  442. }
  443. ]
  444. }
  445. },
  446. plots: {
  447. "town-75056" : {
  448. value: "2268265",
  449. latitude: 48.86,
  450. longitude: 2.3444444444444,
  451. href : "#",
  452. tooltip: {content : "<span style=\"font-weight:bold;\">Paris (75056)</span><br />Population : 2268265"}
  453. },
  454. "town-13055" : {
  455. value: "859368",
  456. latitude: 43.296666666667,
  457. longitude: 5.3763888888889,
  458. href : "#",
  459. tooltip: {content : "<span style=\"font-weight:bold;\">Marseille (13055)</span><br />Population : 859368"}
  460. },
  461. "town-69123" : {
  462. value: "492578",
  463. latitude: 45.758888888889,
  464. longitude: 4.8413888888889,
  465. href : "#",
  466. tooltip: {content : "<span style=\"font-weight:bold;\">Lyon (69123)</span><br />Population : 492578"}
  467. },
  468. "town-31555" : {
  469. value: "449328",
  470. latitude: 43.604444444444,
  471. longitude: 1.4419444444444,
  472. href : "#",
  473. tooltip: {content : "<span style=\"font-weight:bold;\">Toulouse (31555)</span><br />Population : 449328"}
  474. },
  475. "town-06088" : {
  476. value: "347105",
  477. latitude: 43.701944444444,
  478. longitude: 7.2683333333333,
  479. href : "#",
  480. tooltip: {content : "<span style=\"font-weight:bold;\">Nice (06088)</span><br />Population : 347105"}
  481. },
  482. "town-44109" : {
  483. value: "293234",
  484. latitude: 47.217222222222,
  485. longitude: -1.5538888888889,
  486. href : "#",
  487. tooltip: {content : "<span style=\"font-weight:bold;\">Nantes (44109)</span><br />Population : 293234"}
  488. },
  489. "town-67482" : {
  490. value: "276401",
  491. latitude: 48.583611111111,
  492. longitude: 7.7480555555556,
  493. href : "#",
  494. tooltip: {content : "<span style=\"font-weight:bold;\">Strasbourg (67482)</span><br />Population : 276401"}
  495. },
  496. "town-34172" : {
  497. value: "260572",
  498. latitude: 43.611111111111,
  499. longitude: 3.8766666666667,
  500. href : "#",
  501. tooltip: {content : "<span style=\"font-weight:bold;\">Montpellier (34172)</span><br />Population : 260572"}
  502. },
  503. "town-33063" : {
  504. value: "242945",
  505. latitude: 44.837777777778,
  506. longitude: -0.57944444444444,
  507. href : "#",
  508. tooltip: {content : "<span style=\"font-weight:bold;\">Bordeaux (33063)</span><br />Population : 242945"}
  509. },
  510. "town-59350" : {
  511. value: "234058",
  512. latitude: 50.631944444444,
  513. longitude: 3.0575,
  514. href : "#",
  515. tooltip: {content : "<span style=\"font-weight:bold;\">Lille (59350)</span><br />Population : 234058"}
  516. },
  517. "town-35238" : {
  518. value: "212939",
  519. latitude: 48.114166666667,
  520. longitude: -1.6808333333333,
  521. href : "#",
  522. tooltip: {content : "<span style=\"font-weight:bold;\">Rennes (35238)</span><br />Population : 212939"}
  523. },
  524. "town-51454" : {
  525. value: "184011",
  526. latitude: 49.265277777778,
  527. longitude: 4.0286111111111,
  528. href : "#",
  529. tooltip: {content : "<span style=\"font-weight:bold;\">Reims (51454)</span><br />Population : 184011"}
  530. },
  531. "town-76351" : {
  532. value: "178070",
  533. latitude: 49.498888888889,
  534. longitude: 0.12111111111111,
  535. href : "#",
  536. tooltip: {content : "<span style=\"font-weight:bold;\">Le Havre (76351)</span><br />Population : 178070"}
  537. },
  538. "town-42218" : {
  539. value: "174566",
  540. latitude: 45.433888888889,
  541. longitude: 4.3897222222222,
  542. href : "#",
  543. tooltip: {content : "<span style=\"font-weight:bold;\">Saint-Étienne (42218)</span><br />Population : 174566"}
  544. },
  545. "town-83137" : {
  546. value: "166851",
  547. latitude: 43.125,
  548. longitude: 5.9305555555556,
  549. href : "#",
  550. tooltip: {content : "<span style=\"font-weight:bold;\">Toulon (83137)</span><br />Population : 166851"}
  551. },
  552. "town-38185" : {
  553. value: "158249",
  554. latitude: 45.186944444444,
  555. longitude: 5.7263888888889,
  556. href : "#",
  557. tooltip: {content : "<span style=\"font-weight:bold;\">Grenoble (38185)</span><br />Population : 158249"}
  558. },
  559. "town-21231" : {
  560. value: "155233",
  561. latitude: 47.323055555556,
  562. longitude: 5.0419444444444,
  563. href : "#",
  564. tooltip: {content : "<span style=\"font-weight:bold;\">Dijon (21231)</span><br />Population : 155233"}
  565. },
  566. "town-49007" : {
  567. value: "151957",
  568. latitude: 47.472777777778,
  569. longitude: -0.55555555555556,
  570. href : "#",
  571. tooltip: {content : "<span style=\"font-weight:bold;\">Angers (49007)</span><br />Population : 151957"}
  572. },
  573. "town-72181" : {
  574. value: "147108",
  575. latitude: 48.004166666667,
  576. longitude: 0.19694444444444,
  577. href : "#",
  578. tooltip: {content : "<span style=\"font-weight:bold;\">Le Mans (72181)</span><br />Population : 147108"}
  579. },
  580. "town-69266" : {
  581. value: "146729",
  582. latitude: 45.766111111111,
  583. longitude: 4.8794444444444,
  584. href : "#",
  585. tooltip: {content : "<span style=\"font-weight:bold;\">Villeurbanne (69266)</span><br />Population : 146729"}
  586. },
  587. "town-97411" : {
  588. value: "146489",
  589. latitude: -20.878888888889,
  590. longitude: 55.448055555556,
  591. href : "#",
  592. tooltip: {content : "<span style=\"font-weight:bold;\">Saint-Denis (97411)</span><br />Population : 146489"}
  593. },
  594. "town-29019" : {
  595. value: "145561",
  596. latitude: 48.39,
  597. longitude: -4.4869444444444,
  598. href : "#",
  599. tooltip: {content : "<span style=\"font-weight:bold;\">Brest (29019)</span><br />Population : 145561"}
  600. },
  601. "town-30189" : {
  602. value: "145501",
  603. latitude: 43.836944444444,
  604. longitude: 4.36,
  605. href : "#",
  606. tooltip: {content : "<span style=\"font-weight:bold;\">Nîmes (30189)</span><br />Population : 145501"}
  607. },
  608. "town-13001" : {
  609. value: "144884",
  610. latitude: 43.527777777778,
  611. longitude: 5.4455555555556,
  612. href : "#",
  613. tooltip: {content : "<span style=\"font-weight:bold;\">Aix-en-Provence (13001)</span><br />Population : 144884"}
  614. },
  615. "town-63113" : {
  616. value: "143669",
  617. latitude: 45.779722222222,
  618. longitude: 3.0869444444444,
  619. href : "#",
  620. tooltip: {content : "<span style=\"font-weight:bold;\">Clermont-Ferrand (63113)</span><br />Population : 143669"}
  621. },
  622. "town-87085" : {
  623. value: "141540",
  624. latitude: 45.834444444444,
  625. longitude: 1.2616666666667,
  626. href : "#",
  627. tooltip: {content : "<span style=\"font-weight:bold;\">Limoges (87085)</span><br />Population : 141540"}
  628. },
  629. "town-37261" : {
  630. value: "138268",
  631. latitude: 47.392777777778,
  632. longitude: 0.68833333333333,
  633. href : "#",
  634. tooltip: {content : "<span style=\"font-weight:bold;\">Tours (37261)</span><br />Population : 138268"}
  635. },
  636. "town-80021" : {
  637. value: "136512",
  638. latitude: 49.891944444444,
  639. longitude: 2.2977777777778,
  640. href : "#",
  641. tooltip: {content : "<span style=\"font-weight:bold;\">Amiens (80021)</span><br />Population : 136512"}
  642. },
  643. "town-57463" : {
  644. value: "122928",
  645. latitude: 49.119722222222,
  646. longitude: 6.1769444444444,
  647. href : "#",
  648. tooltip: {content : "<span style=\"font-weight:bold;\">Metz (57463)</span><br />Population : 122928"}
  649. },
  650. "town-25056" : {
  651. value: "121038",
  652. latitude: 47.242222222222,
  653. longitude: 6.0213888888889,
  654. href : "#",
  655. tooltip: {content : "<span style=\"font-weight:bold;\">Besançon (25056)</span><br />Population : 121038"}
  656. },
  657. "town-66136" : {
  658. value: "119536",
  659. latitude: 42.6975,
  660. longitude: 2.8947222222222,
  661. href : "#",
  662. tooltip: {content : "<span style=\"font-weight:bold;\">Perpignan (66136)</span><br />Population : 119536"}
  663. },
  664. "town-45234" : {
  665. value: "117833",
  666. latitude: 47.902222222222,
  667. longitude: 1.9041666666667,
  668. href : "#",
  669. tooltip: {content : "<span style=\"font-weight:bold;\">Orléans (45234)</span><br />Population : 117833"}
  670. },
  671. "town-92012" : {
  672. value: "115264",
  673. latitude: 48.835277777778,
  674. longitude: 2.2413888888889,
  675. href : "#",
  676. tooltip: {content : "<span style=\"font-weight:bold;\">Boulogne-Billancourt (92012)</span><br />Population : 115264"}
  677. },
  678. "town-76540" : {
  679. value: "113461",
  680. latitude: 49.443055555556,
  681. longitude: 1.1025,
  682. href : "#",
  683. tooltip: {content : "<span style=\"font-weight:bold;\">Rouen (76540)</span><br />Population : 113461"}
  684. },
  685. "town-14118" : {
  686. value: "111949",
  687. latitude: 49.182222222222,
  688. longitude: -0.37055555555556,
  689. href : "#",
  690. tooltip: {content : "<span style=\"font-weight:bold;\">Caen (14118)</span><br />Population : 111949"}
  691. },
  692. "town-68224" : {
  693. value: "111273",
  694. latitude: 47.748611111111,
  695. longitude: 7.3391666666667,
  696. href : "#",
  697. tooltip: {content : "<span style=\"font-weight:bold;\">Mulhouse (68224)</span><br />Population : 111273"}
  698. },
  699. "town-93066" : {
  700. value: "107959",
  701. latitude: 48.935555555556,
  702. longitude: 2.3538888888889,
  703. href : "#",
  704. tooltip: {content : "<span style=\"font-weight:bold;\">Saint-Denis (93066)</span><br />Population : 107959"}
  705. },
  706. "town-93066" : {
  707. value: "107959",
  708. latitude: 48.935555555556,
  709. longitude: 2.3538888888889,
  710. href : "#",
  711. tooltip: {content : "<span style=\"font-weight:bold;\">Saint-Denis (93066)</span><br />Population : 107959"}
  712. },
  713. "town-54395" : {
  714. value: "107710",
  715. latitude: 48.692777777778,
  716. longitude: 6.1836111111111,
  717. href : "#",
  718. tooltip: {content : "<span style=\"font-weight:bold;\">Nancy (54395)</span><br />Population : 107710"}
  719. },
  720. "town-95018" : {
  721. value: "104843",
  722. latitude: 48.947777777778,
  723. longitude: 2.2475,
  724. href : "#",
  725. tooltip: {content : "<span style=\"font-weight:bold;\">Argenteuil (95018)</span><br />Population : 104843"}
  726. },
  727. "town-02738" : {
  728. value: "14320",
  729. latitude: 49.655833333333,
  730. longitude: 3.2872222222222,
  731. href : "#",
  732. tooltip: {content : "<span style=\"font-weight:bold;\">Tergnier (02738)</span><br />Population : 14320"}
  733. },
  734. "town-01004" : {
  735. value: "14316",
  736. latitude: 45.958055555556,
  737. longitude: 5.3577777777778,
  738. href : "#",
  739. tooltip: {content : "<span style=\"font-weight:bold;\">Ambérieu-en-Bugey (01004)</span><br />Population : 14316"}
  740. },
  741. "town-91661" : {
  742. value: "9825",
  743. latitude: 48.701388888889,
  744. longitude: 2.245,
  745. href : "#",
  746. tooltip: {content : "<span style=\"font-weight:bold;\">Villebon-sur-Yvette (91661)</span><br />Population : 9825"}
  747. },
  748. "town-63014" : {
  749. value: "9824",
  750. latitude: 45.750833333333,
  751. longitude: 3.1108333333333,
  752. href : "#",
  753. tooltip: {content : "<span style=\"font-weight:bold;\">Aubière (63014)</span><br />Population : 9824"}
  754. },
  755. "town-60282" : {
  756. value: "9819",
  757. latitude: 49.187777777778,
  758. longitude: 2.4161111111111,
  759. href : "#",
  760. tooltip: {content : "<span style=\"font-weight:bold;\">Gouvieux (60282)</span><br />Population : 9819"}
  761. },
  762. "town-69271" : {
  763. value: "9813",
  764. latitude: 45.744444444444,
  765. longitude: 4.9663888888889,
  766. href : "#",
  767. tooltip: {content : "<span style=\"font-weight:bold;\">Chassieu (69271)</span><br />Population : 9813"}
  768. },
  769. "town-33366" : {
  770. value: "9809",
  771. latitude: 44.994722222222,
  772. longitude: -0.44583333333333,
  773. href : "#",
  774. tooltip: {content : "<span style=\"font-weight:bold;\">Saint-André-de-Cubzac (33366)</span><br />Population : 9809"}
  775. },
  776. "town-31451" : {
  777. value: "9795",
  778. latitude: 43.458611111111,
  779. longitude: 2.0041666666667,
  780. href : "#",
  781. tooltip: {content : "<span style=\"font-weight:bold;\">Revel (31451)</span><br />Population : 9795"}
  782. },
  783. "town-59011" : {
  784. value: "9775",
  785. latitude: 50.529444444444,
  786. longitude: 2.9327777777778,
  787. href : "#",
  788. tooltip: {content : "<span style=\"font-weight:bold;\">Annœullin (59011)</span><br />Population : 9775"}
  789. },
  790. "town-13069" : {
  791. value: "9771",
  792. latitude: 43.631388888889,
  793. longitude: 5.1505555555556,
  794. href : "#",
  795. tooltip: {content : "<span style=\"font-weight:bold;\">Pélissanne (13069)</span><br />Population : 9771"}
  796. },
  797. "town-91122" : {
  798. value: "9769",
  799. latitude: 48.696666666667,
  800. longitude: 2.1613888888889,
  801. href : "#",
  802. tooltip: {content : "<span style=\"font-weight:bold;\">Bures-sur-Yvette (91122)</span><br />Population : 9769"}
  803. },
  804. "town-02381" : {
  805. value: "9756",
  806. latitude: 49.921666666667,
  807. longitude: 4.0838888888889,
  808. href : "#",
  809. tooltip: {content : "<span style=\"font-weight:bold;\">Hirson (02381)</span><br />Population : 9756"}
  810. }
  811. }
  812. });
  813. // Example #6
  814. $(".maparea6").mapael({
  815. map : {
  816. name : "world_countries",
  817. defaultArea: {
  818. attrs : {
  819. stroke : "#fff",
  820. "stroke-width" : 1
  821. }
  822. }
  823. },
  824. legend : {
  825. area : {
  826. display : true,
  827. title :"Population by country",
  828. slices : [
  829. {
  830. max :5000000,
  831. attrs : {
  832. fill : "#6aafe1"
  833. },
  834. label :"Less than de 5000000 inhabitants"
  835. },
  836. {
  837. min :5000000,
  838. max :10000000,
  839. attrs : {
  840. fill : "#459bd9"
  841. },
  842. label :"Between 5000000 and 10000000 inhabitants"
  843. },
  844. {
  845. min :10000000,
  846. max :50000000,
  847. attrs : {
  848. fill : "#2579b5"
  849. },
  850. label :"Between 10000000 and 50000000 inhabitants"
  851. },
  852. {
  853. min :50000000,
  854. attrs : {
  855. fill : "#1a527b"
  856. },
  857. label :"More than 50 million inhabitants"
  858. }
  859. ]
  860. },
  861. plot :{
  862. display : true,
  863. title: "Some cities ..."
  864. , slices : [
  865. {
  866. max :500000,
  867. attrs : {
  868. fill : "#f99200"
  869. },
  870. attrsHover :{
  871. transform : "s1.5",
  872. "stroke-width" : 1
  873. },
  874. label :"less than 500 000 inhabitants",
  875. size : 10
  876. },
  877. {
  878. min :500000,
  879. max :1000000,
  880. attrs : {
  881. fill : "#f99200"
  882. },
  883. attrsHover :{
  884. transform : "s1.5",
  885. "stroke-width" : 1
  886. },
  887. label :"Between 500 000 and 1 000 000 inhabitants",
  888. size : 20
  889. },
  890. {
  891. min :1000000,
  892. attrs : {
  893. fill : "#f99200"
  894. },
  895. attrsHover :{
  896. transform : "s1.5",
  897. "stroke-width" : 1
  898. },
  899. label :"More than 1 million inhabitants",
  900. size : 30
  901. }
  902. ]
  903. }
  904. },
  905. plots : {
  906. 'paris' : {
  907. latitude :48.86,
  908. longitude :2.3444,
  909. value : 500000000,
  910. tooltip: {content : "Paris<br />Population: 500000000"}
  911. },
  912. 'newyork' : {
  913. latitude :40.667,
  914. longitude :-73.833,
  915. value : 200001,
  916. tooltip: {content : "New york<br />Population: 200001"}
  917. },
  918. 'sydney' : {
  919. latitude :-33.917,
  920. longitude :151.167,
  921. value : 600000,
  922. tooltip: {content : "Sydney<br />Population: 600000"}
  923. },
  924. 'brasilia' : {
  925. latitude :-15.781682,
  926. longitude :-47.924195,
  927. value : 200000001,
  928. tooltip: {content : "Brasilia<br />Population: 200000001"}
  929. },
  930. 'tokyo': {
  931. latitude :35.687418,
  932. longitude :139.692306,
  933. value : 200001,
  934. tooltip: {content : "Tokyo<br />Population: 200001"}
  935. }
  936. },
  937. areas: {
  938. "AF": {
  939. "value": "35320445",
  940. "attrs": {
  941. "href": "#"
  942. },
  943. "tooltip": {
  944. "content": "<span style=\"font-weight:bold;\">Afghanistan<\/span><br \/>Population : 35320445"
  945. }
  946. },
  947. "ZA": {
  948. "value": "50586757",
  949. "attrs": {
  950. "href": "#"
  951. },
  952. "tooltip": {
  953. "content": "<span style=\"font-weight:bold;\">South Africa<\/span><br \/>Population : 50586757"
  954. }
  955. },
  956. "AL": {
  957. "value": "3215988",
  958. "attrs": {
  959. "href": "#"
  960. },
  961. "tooltip": {
  962. "content": "<span style=\"font-weight:bold;\">Albania<\/span><br \/>Population : 3215988"
  963. }
  964. },
  965. "DZ": {
  966. "value": "35980193",
  967. "attrs": {
  968. "href": "#"
  969. },
  970. "tooltip": {
  971. "content": "<span style=\"font-weight:bold;\">Algeria<\/span><br \/>Population : 35980193"
  972. }
  973. },
  974. "DE": {
  975. "value": "81726000",
  976. "attrs": {
  977. "href": "#"
  978. },
  979. "tooltip": {
  980. "content": "<span style=\"font-weight:bold;\">Germany<\/span><br \/>Population : 81726000"
  981. }
  982. },
  983. "AD": {
  984. "value": "86165",
  985. "attrs": {
  986. "href": "#"
  987. },
  988. "tooltip": {
  989. "content": "<span style=\"font-weight:bold;\">Andorra<\/span><br \/>Population : 86165"
  990. }
  991. },
  992. "AO": {
  993. "value": "19618432",
  994. "attrs": {
  995. "href": "#"
  996. },
  997. "tooltip": {
  998. "content": "<span style=\"font-weight:bold;\">Angola<\/span><br \/>Population : 19618432"
  999. }
  1000. },
  1001. "AG": {
  1002. "value": "89612",
  1003. "attrs": {
  1004. "href": "#"
  1005. },
  1006. "tooltip": {
  1007. "content": "<span style=\"font-weight:bold;\">Antigua And Barbuda<\/span><br \/>Population : 89612"
  1008. }
  1009. },
  1010. "SA": {
  1011. "value": "28082541",
  1012. "attrs": {
  1013. "href": "#"
  1014. },
  1015. "tooltip": {
  1016. "content": "<span style=\"font-weight:bold;\">Saudi Arabia<\/span><br \/>Population : 28082541"
  1017. }
  1018. },
  1019. "AR": {
  1020. "value": "40764561",
  1021. "attrs": {
  1022. "href": "#"
  1023. },
  1024. "tooltip": {
  1025. "content": "<span style=\"font-weight:bold;\">Argentina<\/span><br \/>Population : 40764561"
  1026. }
  1027. },
  1028. "AM": {
  1029. "value": "3100236",
  1030. "attrs": {
  1031. "href": "#"
  1032. },
  1033. "tooltip": {
  1034. "content": "<span style=\"font-weight:bold;\">Armenia<\/span><br \/>Population : 3100236"
  1035. }
  1036. },
  1037. "AU": {
  1038. "value": "22620600",
  1039. "attrs": {
  1040. "href": "#"
  1041. },
  1042. "tooltip": {
  1043. "content": "<span style=\"font-weight:bold;\">Australia<\/span><br \/>Population : 22620600"
  1044. }
  1045. },
  1046. "AT": {
  1047. "value": "8419000",
  1048. "attrs": {
  1049. "href": "#"
  1050. },
  1051. "tooltip": {
  1052. "content": "<span style=\"font-weight:bold;\">Austria<\/span><br \/>Population : 8419000"
  1053. }
  1054. },
  1055. "AZ": {
  1056. "value": "9168000",
  1057. "attrs": {
  1058. "href": "#"
  1059. },
  1060. "tooltip": {
  1061. "content": "<span style=\"font-weight:bold;\">Azerbaijan<\/span><br \/>Population : 9168000"
  1062. }
  1063. },
  1064. "BS": {
  1065. "value": "347176",
  1066. "attrs": {
  1067. "href": "#"
  1068. },
  1069. "tooltip": {
  1070. "content": "<span style=\"font-weight:bold;\">Bahamas<\/span><br \/>Population : 347176"
  1071. }
  1072. },
  1073. "BH": {
  1074. "value": "1323535",
  1075. "attrs": {
  1076. "href": "#"
  1077. },
  1078. "tooltip": {
  1079. "content": "<span style=\"font-weight:bold;\">Bahrain<\/span><br \/>Population : 1323535"
  1080. }
  1081. },
  1082. "BD": {
  1083. "value": "150493658",
  1084. "attrs": {
  1085. "href": "#"
  1086. },
  1087. "tooltip": {
  1088. "content": "<span style=\"font-weight:bold;\">Bangladesh<\/span><br \/>Population : 150493658"
  1089. }
  1090. },
  1091. "BB": {
  1092. "value": "273925",
  1093. "attrs": {
  1094. "href": "#"
  1095. },
  1096. "tooltip": {
  1097. "content": "<span style=\"font-weight:bold;\">Barbados<\/span><br \/>Population : 273925"
  1098. }
  1099. },
  1100. "BE": {
  1101. "value": "11008000",
  1102. "attrs": {
  1103. "href": "#"
  1104. },
  1105. "tooltip": {
  1106. "content": "<span style=\"font-weight:bold;\">Belgium<\/span><br \/>Population : 11008000"
  1107. }
  1108. },
  1109. "BZ": {
  1110. "value": "356600",
  1111. "attrs": {
  1112. "href": "#"
  1113. },
  1114. "tooltip": {
  1115. "content": "<span style=\"font-weight:bold;\">Belize<\/span><br \/>Population : 356600"
  1116. }
  1117. },
  1118. "BJ": {
  1119. "value": "9099922",
  1120. "attrs": {
  1121. "href": "#"
  1122. },
  1123. "tooltip": {
  1124. "content": "<span style=\"font-weight:bold;\">Benin<\/span><br \/>Population : 9099922"
  1125. }
  1126. },
  1127. "BT": {
  1128. "value": "738267",
  1129. "attrs": {
  1130. "href": "#"
  1131. },
  1132. "tooltip": {
  1133. "content": "<span style=\"font-weight:bold;\">Bhutan<\/span><br \/>Population : 738267"
  1134. }
  1135. },
  1136. "BY": {
  1137. "value": "9473000",
  1138. "attrs": {
  1139. "href": "#"
  1140. },
  1141. "tooltip": {
  1142. "content": "<span style=\"font-weight:bold;\">Belarus<\/span><br \/>Population : 9473000"
  1143. }
  1144. },
  1145. "MM": {
  1146. "value": "48336763",
  1147. "attrs": {
  1148. "href": "#"
  1149. },
  1150. "tooltip": {
  1151. "content": "<span style=\"font-weight:bold;\">Myanmar<\/span><br \/>Population : 48336763"
  1152. }
  1153. },
  1154. "BO": {
  1155. "value": "10088108",
  1156. "attrs": {
  1157. "href": "#"
  1158. },
  1159. "tooltip": {
  1160. "content": "<span style=\"font-weight:bold;\">Bolivia, Plurinational State Of<\/span><br \/>Population : 10088108"
  1161. }
  1162. },
  1163. "BA": {
  1164. "value": "3752228",
  1165. "attrs": {
  1166. "href": "#"
  1167. },
  1168. "tooltip": {
  1169. "content": "<span style=\"font-weight:bold;\">Bosnia And Herzegovina<\/span><br \/>Population : 3752228"
  1170. }
  1171. },
  1172. "BW": {
  1173. "value": "2030738",
  1174. "attrs": {
  1175. "href": "#"
  1176. },
  1177. "tooltip": {
  1178. "content": "<span style=\"font-weight:bold;\">Botswana<\/span><br \/>Population : 2030738"
  1179. }
  1180. },
  1181. "BR": {
  1182. "value": "196655014",
  1183. "attrs": {
  1184. "href": "#"
  1185. },
  1186. "tooltip": {
  1187. "content": "<span style=\"font-weight:bold;\">Brazil<\/span><br \/>Population : 196655014"
  1188. }
  1189. },
  1190. "BN": {
  1191. "value": "405938",
  1192. "attrs": {
  1193. "href": "#"
  1194. },
  1195. "tooltip": {
  1196. "content": "<span style=\"font-weight:bold;\">Brunei Darussalam<\/span><br \/>Population : 405938"
  1197. }
  1198. },
  1199. "BG": {
  1200. "value": "7476000",
  1201. "attrs": {
  1202. "href": "#"
  1203. },
  1204. "tooltip": {
  1205. "content": "<span style=\"font-weight:bold;\">Bulgaria<\/span><br \/>Population : 7476000"
  1206. }
  1207. },
  1208. "BF": {
  1209. "value": "16967845",
  1210. "attrs": {
  1211. "href": "#"
  1212. },
  1213. "tooltip": {
  1214. "content": "<span style=\"font-weight:bold;\">Burkina Faso<\/span><br \/>Population : 16967845"
  1215. }
  1216. },
  1217. "BI": {
  1218. "value": "8575172",
  1219. "attrs": {
  1220. "href": "#"
  1221. },
  1222. "tooltip": {
  1223. "content": "<span style=\"font-weight:bold;\">Burundi<\/span><br \/>Population : 8575172"
  1224. }
  1225. },
  1226. "KH": {
  1227. "value": "14305183",
  1228. "attrs": {
  1229. "href": "#"
  1230. },
  1231. "tooltip": {
  1232. "content": "<span style=\"font-weight:bold;\">Cambodia<\/span><br \/>Population : 14305183"
  1233. }
  1234. },
  1235. "CM": {
  1236. "value": "20030362",
  1237. "attrs": {
  1238. "href": "#"
  1239. },
  1240. "tooltip": {
  1241. "content": "<span style=\"font-weight:bold;\">Cameroon<\/span><br \/>Population : 20030362"
  1242. }
  1243. },
  1244. "CA": {
  1245. "value": "34482779",
  1246. "attrs": {
  1247. "href": "#"
  1248. },
  1249. "tooltip": {
  1250. "content": "<span style=\"font-weight:bold;\">Canada<\/span><br \/>Population : 34482779"
  1251. }
  1252. },
  1253. "CV": {
  1254. "value": "500585",
  1255. "attrs": {
  1256. "href": "#"
  1257. },
  1258. "tooltip": {
  1259. "content": "<span style=\"font-weight:bold;\">Cape Verde<\/span><br \/>Population : 500585"
  1260. }
  1261. },
  1262. "ZW": {
  1263. "value": "12754378",
  1264. "attrs": {
  1265. "href": "#"
  1266. },
  1267. "tooltip": {
  1268. "content": "<span style=\"font-weight:bold;\">Zimbabwe<\/span><br \/>Population : 12754378"
  1269. }
  1270. }
  1271. }
  1272. });
  1273. // Example #7
  1274. $(".maparea7").mapael({
  1275. map : {
  1276. name : "usa_states"
  1277. },
  1278. plots: {
  1279. 'ny' : {
  1280. latitude: 40.717079,
  1281. longitude: -74.00116,
  1282. tooltip: {content : "New York"}
  1283. },
  1284. 'an' : {
  1285. latitude: 61.2108398,
  1286. longitude: -149.9019557,
  1287. tooltip: {content : "Anchorage"}
  1288. },
  1289. 'sf' : {
  1290. latitude: 37.792032,
  1291. longitude: -122.394613,
  1292. tooltip: {content : "San Francisco"}
  1293. },
  1294. 'pa' : {
  1295. latitude: 19.493204,
  1296. longitude: -154.8199569,
  1297. tooltip: {content : "Pahoa"}
  1298. }
  1299. }
  1300. });
  1301. });