User:KokoroSenshi/Sandbox/Imagemaps

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search
TP Hyrule Map.pngSouth Hyrule FieldHyrule FieldKakariko GorgeOrdon RanchOrdon VillageOrdon SpringFaron WoodsFaron WoodsSacred GroveEldin SpringKakariko Village GraveyardKakariko VillageDeath MountainGerudo DesertArbiter's Grounds (Dungeon)Mirror ChamberBridge of EldinHidden VillageLake HyliaGreat Hylian BridgeLake HyliaHyrule FieldHyrule CastleZora's DomainSnowpeak TopSnowpeakSnowpeakSnowpeak RuinsZora's River


<imagemap> File:TP Hyrule Map.png| <!-- x400px means x-dir is 400px? --> poly 319 320 302 331 299 343 298 364 306 383 325 392 341 385 354 377 358 360 343 355 342 335 334 325 [[Hyrule Field#Twilight Princess|South Hyrule Field]] poly 405 192 386 200 372 209 369 231 373 254 396 258 422 256 443 257 469 257 480 236 479 216 471 200 461 198 443 203 424 198 [[Hyrule Field#Twilight Princess|Hyrule Field]] poly 360 316 373 326 387 335 397 333 410 322 416 308 403 298 384 289 371 300 [[Kakariko Gorge]] poly 323 530 317 537 324 548 334 542 331 535 [[Ordon Ranch]] poly 328 500 322 505 318 515 328 518 332 511 338 502 [[Ordon Village]] rect 307 477 326 490 [[Ordon Spring]] rect 314 411 333 475 [[Faron Woods]] rect 276 397 314 432 [[Faron Woods]] rect 243 384 270 423 [[Sacred Grove]] rect 472 326 487 348 [[Eldin Spring]] rect 493 316 508 329 [[Kakariko Village Graveyard#Twilight Princess|Kakariko Village Graveyard]] rect 460 299 488 327 [[Kakariko Village#Twilight Princess|Kakariko Village]] rect 497 218 521 288 [[Death Mountain#Twilight Princess|Death Mountain]] poly 89 293 109 293 128 299 123 314 145 314 155 329 187 325 171 340 164 347 194 334 206 348 203 367 183 360 161 364 140 366 111 371 104 361 92 370 74 365 63 355 82 346 76 334 64 327 70 306 81 298 [[Gerudo Desert]] rect 75 250 98 281 [[Arbiter's Grounds]] rect 76 216 99 247 [[Mirror Chamber]] rect 457 163 472 194 [[Bridge of Eldin]] rect 413 127 428 155 [[Hidden Village]] poly 227 268 213 280 198 284 186 296 194 316 214 329 232 326 237 305 236 280 [[Lake Hylia]] rect 239 271 249 313 [[Great Hylian Bridge]] poly 257 270 271 276 272 294 275 319 264 317 254 308 253 285 [[Lake Hylia]] rect 296 228 335 288 [[Hyrule Field]] poly 315 167 308 179 304 186 290 193 291 222 340 224 338 200 325 187 [[Hyrule Castle#Twilight Princess|Hyrule Castle]] rect 309 33 335 83 [[Zora's Domain]] poly 379 74 378 84 385 96 378 105 382 120 371 145 381 161 402 169 382 188 357 204 358 221 354 239 353 252 364 254 364 226 368 207 390 198 409 186 438 195 466 190 495 164 493 132 474 109 457 94 447 91 434 87 408 78 390 80 394 103 401 114 390 118 380 134 383 152 401 162 407 182 428 180 459 181 484 169 493 149 486 119 464 106 445 100 421 85 [[Zora's River]] rect 221 43 248 73 [[Snowpeak Top]] poly 207 63 190 56 175 62 164 66 159 90 158 112 154 130 143 142 163 159 177 171 174 192 157 189 137 182 125 191 142 194 166 202 189 186 189 168 173 159 163 138 166 115 167 99 168 78 181 71 200 75 [[Snowpeak]] rect 247 38 298 74 [[Snowpeak]] rect 113 159 131 186 [[Snowpeak Ruins]] desc none </imagemap>

var stuff = document.getElementById("StuffGoesHere").innerHTML; //alert(stuff) var output="<img src=\"[20110115214118!Hyrule_TP_Map] (imported)\" usemap=\"#map\" />" +"\n"+"<map name=\"map\">"; var stuffArray = stuff.split("\n"); //console.log(stuffArray); var arrLen = stuffArray.length; var coordArray = []; var coordLen = 0; var mapArea = false; for (var i = 0; i < arrLen; i++) { lineString = stuffArray[i]; mapArea = false; if (lineString != undefined) { if (lineString.search("rect" ) != -1) { output=output+"\n"+"<area shape=\"rect\" coords=\""; mapArea = true; } else if (lineString.search("circle") != -1) { output=output+"\n"+"<area shape=\"circle\" coords=\""; mapArea = true; } else if (lineString.search("poly" ) != -1) { output=output+"\n"+"<area shape=\"poly\" coords=\""; mapArea = true; } if (mapArea) { coordArray = lineString.match(/[0-9]+/g); coordLen = coordArray.length; output=output+coordArray[0]; for (var j = 1; j < coordLen; j++) { output=output+","+coordArray[j]; } output=output+"\" href=\""+lineString.match(/\[\[.*\]\]/i)[0]+"\" />"; } } } output=output+"\n"+"<\/map>"; console.log(output);