{"id":41942,"date":"2022-04-24T20:19:55","date_gmt":"2022-04-24T18:19:55","guid":{"rendered":"https:\/\/jonkopingmarathon.se\/map-marathon\/"},"modified":"2024-10-29T08:30:08","modified_gmt":"2024-10-29T07:30:08","slug":"map-marathon","status":"publish","type":"page","link":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/","title":{"rendered":"Map Marathon"},"content":{"rendered":"<h2>Run 42 195 m through beautiful J\u00f6nk\u00f6ping.<\/h2>\n<p>In 2022, we redrew the marathon course. Fewer vertical metres but still a lot of beautiful views along our beautiful city. A varied course profile with beautiful scenery and supportive crowds along the course.<\/p>\n<p>Have you set a personal best on the old track? Then you&#8217;ll love the new route!<\/p>\n<p>Distance: 42,195 meters<br \/>Hydration stations: 12 along the course + 1 at the Start\/Finish<\/p>\n<\/p>\n<p><!--[jm-marathon-map] Tips: f\u00f6r musen \u00f6ver banprofilen f\u00f6r att se vilket omr\u00e5de p\u00e5 banan profilen g\u00e4ller. Klicka p\u00e5 v\u00e4tskestationer f\u00f6r att se vad som kommer att serveras d\u00e4r. Klicka p\u00e5 kilometermarkeringar f\u00f6r att se vilka tider ber\u00e4knas komma f\u00f6rsta och sista l\u00f6paren p\u00e5 just den kilometern. &nbsp; \n\n<h2>Karta f\u00f6r utskrift<\/h2>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nKlicka p\u00e5 bilden nedan s\u00e5 \u00f6ppnas kartan i ett nytt f\u00f6nster i PDF format.--><\/p>\n<div id=\"map-canvas\" style=\"width:100%; height:600px\"><\/div>\n<div class=\"elevation-profile-container\" style=\"height:250px\">\n    <canvas id=\"route-elevation-chart\" style=\"width:100%;height:100%\"><\/canvas>\n<\/div>\n\n<script type=\"text\/javascript\">\n\tvar map;\n    var elevations = [];\n    var elevationsOnly = [];\n    var distancesOnly = [];\n    var selectedPoint;\n\t\/\/ Load the Visualization API and the columnchart package.\n\t\/\/ @ts-ignore TODO(jpoehnelt) update to newest visualization library\n\t\/\/google.charts.load('current', {packages: ['corechart']});\n\t\/\/google.charts.setOnLoadCallback(plotElevation);\n\n\n\tvar add_minutes =  function (dt, minutes) {\n\t    var date = new Date(dt.getTime() + minutes*60000);\n\t    return date.toLocaleTimeString('sv-SE', {hour: '2-digit', minute:'2-digit'});\n\t}\n\n    function jmMap() {\n    \t\/\/ICON DEFINITIONS\n    \tconst starticon = {\n\t\t    url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/start-marker.png\", \/\/ url\n\t\t    scaledSize: new google.maps.Size(77, 45), \/\/ scaled size\n\t\t    origin: new google.maps.Point(0,0), \/\/ origin\n\t\t    anchor: new google.maps.Point(50, 40) \/\/ anchor\n\t\t};\n\n\t\tconst kmicon = {\n\t\t    url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/km-marker.png\", \/\/ url\n\t\t    scaledSize: new google.maps.Size(20, 20), \/\/ scaled size\n\t\t    origin: new google.maps.Point(0,0), \/\/ origin\n\t\t    anchor: new google.maps.Point(10, 10) \/\/ anchor\n\t\t};\n\n        const watericon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/water-plus.png\", \/\/ url\n            scaledSize: new google.maps.Size(45, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n\n        const waterminiicon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/water.png\", \/\/ url\n            scaledSize: new google.maps.Size(30, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n\n        const musicicon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/music.png\", \/\/ url\n            scaledSize: new google.maps.Size(30, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n        const duschicon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/dusch-icon.png\", \/\/ url\n            scaledSize: new google.maps.Size(30, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n        const massageicon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/massage-icon.png\", \/\/ url\n            scaledSize: new google.maps.Size(30, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n        const wcicon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/wc.png\", \/\/ url\n            scaledSize: new google.maps.Size(30, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n        const stafetticon = {\n            url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/stafett-icon.png\", \/\/ url\n            scaledSize: new google.maps.Size(30, 30), \/\/ scaled size\n            origin: new google.maps.Point(0,0), \/\/ origin\n            anchor: new google.maps.Point(15, 15) \/\/ anchor\n        };\n\n\t\tvar myLatlng = new google.maps.LatLng( 57.778544605011, 14.169210248169 );\n\t\tvar mapOptions = {\n\t\t\tzoom: 14,\n\t\t\tcenter: myLatlng,\n\t\t\tstreetViewControl: false,\n\t\t\tmapId: '135889510cd9ff73'};\n\t\t\t\/\/mapId: '7db90ec79e62e4fe'};\n\n\t\t\n\t\tmap = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\t\tvar marker = new google.maps.Marker({\n            position: myLatlng,\n            map: map,\n            icon: starticon,\n            zIndex: 28,\n            title: \"Start\/M\u00e5l\"\n        });\n\n        var prev_infowindow =false; \n\n\t\tvar infowindow = new google.maps.InfoWindow();\n\t  \tinfowindow.setContent('Start\/m\u00e5l<br\/>Start 10:00');\n\t  \tgoogle.maps.event.addListener(marker, 'click', function() {\n\t  \t\tif( prev_infowindow ) {\n\t\t           prev_infowindow.close();\n\t\t        }\n\n\t\t    prev_infowindow = infowindow;\n\t      \tinfowindow.open(map, marker);\n\t  \t});\n\n\t  \tjQuery.ajax({\n\t\t  type: \"GET\",\n\t\t  url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/gpx\/marathon2025_elev_distance.gpx\",\n\t\t  dataType: \"xml\",\n\t\t  success: function(xml) {\n\t\t\tvar points = [];\n\t\t\tvar count = 0;\n\t\t\tvar bounds = new google.maps.LatLngBounds ();\n              jQuery(xml).find(\"wpt\").each(function() {\n                  var lat = jQuery(this).attr(\"lat\");\n                  var lon = jQuery(this).attr(\"lon\");\n                  var elev = jQuery(this).find('ele').text();\n                  var desc = jQuery(this).find('desc').text();\n                  var distancestr = desc.substring(desc.length - 9);\n                  var dist = parseFloat(distancestr).toFixed(2);\n                  if(dist == \"NaN\"){\n                      dist = '0';\n                  }\n                  var p = new google.maps.LatLng(lat, lon);\n                  points.push(p);\n                  if(count % 2 || count == 0) {\n                      var elevation = {\n                          lat: parseFloat(lat),\n                          lng: parseFloat(lon),\n                          elevation: parseFloat(elev),\n                          distance: dist\n                      };\n                      elevations.push(elevation);\n                      elevationsOnly.push(elev);\n                      distancesOnly.push(dist);\n                  }\n                  bounds.extend(p);\n                  count++;\n              });\n\n\t\t\tconst lineSymbol = {\n\t\t\t    path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,\n\t\t\t    scale: 2,\n\t\t\t    strokeColor: \"#000000\",\n\t\t    \tfillColor: \"#000000\",\n\t\t    \tfillOpacity: 1\n\t\t\t};\n\n\n\t\t\tvar poly = new google.maps.Polyline({\n\t\t\t  \/\/ use your own style here\n\t\t\t  path: points,\n\t\t\t  strokeColor: \"#2988b7\",\n\t\t\t  strokeOpacity: 1,\n\t\t\t  strokeWeight: 4,\n\t\t\t  icons: [{\n\t\t\t\t  icon: lineSymbol,\n\t\t\t\t  offset: '70%',\n\t\t\t\t  repeat: '150px'\n\t\t\t\t}],\n\t\t\t});\n\t\t\t\n\t\t\tpoly.setMap(map);\n\t\t\t\n\t\t\t\/\/ fit bounds to track\n\t\t\tmap.fitBounds(bounds);\n\n\t\t  }\n\t\t});\n\n\t\t\/* KILOMETRAR *\/\n\t\tvar kmArray = [[57.77931682822717, 14.173895201208556],\n            [57.77107888822517, 14.176591230355248],\n            [57.76854603684945, 14.186166759525138],\n            [57.77467140376485, 14.19730775560777],\n            [57.778762429381786, 14.20036579465507],\n            [57.7773629,14.213440257],\n            [57.777225328,14.226004387],\n            [57.780176678379036, 14.241619509371262],\n            [57.78074670548577, 14.255046390928298],\/\/9\n            [57.784549793960075, 14.264016378740848],\n            [57.79227331392266, 14.266536994535324],\n            [57.7929136750505, 14.254839811544414],\/\/12\n            [57.788597410288084, 14.239576421974322],\n            [57.793849864036396, 14.235594631000389],\n            [57.79061847609885, 14.22191904144117],\n            [57.783935288802795, 14.212712941445306],\/\/16\n            [57.781974554201334, 14.196763082019874],\n            [57.782510012,14.181841747],\n            [57.784518206,14.165716333],\n            [57.788275952,14.151079429],\n            [57.797067286,14.149579861],\n            [57.805076524,14.151847335],\n            [57.812526275898804, 14.153161284700536],\/\/23\n            [57.818608486,14.149884328],\n            [57.81009429,14.153346234],\n            [57.801645612,14.150641844],\n            [57.79260341,14.14900165],\n            [57.785795219,14.157547852],\n            [57.783383749,14.174067056],\n            [57.781942865,14.189950582],\n            [57.77852632028264, 14.19378963111548],\/\/31\n            [57.773963166,14.179657724],\n            [57.779012725,14.171210631],\n            [57.77402827,14.172001043],\n            [57.766293407,14.166824354],\n            [57.767075836,14.153841601],\n            [57.761572516,14.145655403],\n            [57.758963782,14.132511768],\n            [57.766793505,14.139705201],\n            [57.764561327,14.151820898],\n            [57.771307351100866, 14.159044823740642],\n            [57.778224399,14.165465398]];\n\n        var kmMappning = [\n            [1,32.8],\/\/1\n            [2,2],\n            [3,3],\n            [4,4],\n            [5,5],\n            [6,6],\n            [7,7],\n            [8,8],\n            [9,9],\n            [10,10],\n            [11,11],\n            [12,12],\n            [13,13],\n            [14,14],\n            [15,15],\n            [16,16],\n            [17,17],\n            [18,29.5],\/\/18\n            [19,28.5],\/\/19\n            [20,27.5],\/\/20\n            [21,26.5],\/\/21\n            [22,25.5],\/\/22\n            [23,23],\/\/23\n            [24,24],\/\/24\n            [25,25],\/\/25\n            [26,26],\/\/26\n            [20.5,27],\/\/27\n            [19.5,28],\/\/28\n            [18.5,29],\/\/29\n            [17.5,30],\/\/30\n            [4.5,31],\/\/31\n            [19.3,32],\/\/32\n            [33,33],\/\/33\n            [34,34],\/\/34\n            [35,35],\/\/35\n            [36,36],\/\/36\n            [37,37],\/\/37\n            [38,38],\/\/38\n            [39,39],\/\/39\n            [36.4,40],\/\/40\n            [41,41],\/\/41\n            [42,42],\/\/42\n        ];\n\n        var kmMarkersArray = [];\n\t    var kmInfoArray = [];\n\n\t    for (let x = 1; x <= kmArray.length; x++) { \n\t    \tvar kmmarker = new google.maps.Marker({\n                position: new google.maps.LatLng(kmArray[parseInt(x - 1)][0], kmArray[x - 1][1]),\n                map: map,\n                icon: kmicon,\n                label: {\n                    text: String(x),\n                    fontSize: \"10px\"\n                },\n\t\t        zIndex: x,\n\t\t        size: new google.maps.Size(20, 20)\n\t\t    });\n\t\t    kmMarkersArray.push(kmmarker);\n\t\t    if(x > 17){\n\t\t    \tvar first = kmMappning[x-1][0] * 3.15;\n\t\t    \tvar thiskm = x * 3.15;\n\t\t    }\n\t\t    else {\n\t\t    \tvar first = kmMappning[x-1][0] * 3.15;\n\t\t    \tvar thiskm = x * 3.15;\n\t\t    }\t\t    \n\t\t    \n\t\t    var last = kmMappning[x-1][1] * 8.5 + 15;\n\t\t    \n\t\t    var start = new Date(2022,8,20,10,0,0);\n\t\t    var firsttime = add_minutes(start, first).toString();\n\t\t    var lasttime = add_minutes(start, last).toString();\n\t\t    var thiskmtime = add_minutes(start, thiskm).toString();\n\t\t    var infowindow = new google.maps.InfoWindow();\n\t\t  \tinfowindow.setContent('L\u00f6pare passerar ca. <strong>'+firsttime+' - '+lasttime+'<\/strong> <br\/> (b\u00e5da distanser)<br\/>F\u00f6rsta l\u00f6pare till '+x+ ' km  - ca <strong>'+thiskmtime+'<\/strong>');\n\t\t  \tkmInfoArray.push(infowindow);\n\t\t  \tgoogle.maps.event.addListener(kmMarkersArray[parseInt(x-1)], 'click', function() {\n\t\t  \t\tif( prev_infowindow ) {\n\t\t           prev_infowindow.close();\n\t\t        }\n\n\t\t        prev_infowindow = kmInfoArray[parseInt(x-1)];\n\t\t      \tkmInfoArray[parseInt(x-1)].open(map, kmMarkersArray[parseInt(x-1)],false);\n\t\t  \t});\n\t    }\n\n\t\t\/\/function to get the km-markers coords. Remove comment marks, run on localhost, copy coordinates from console and create km-array from it. Put back comment marks.\n\t\t\/*var kms = {};\n\t    jQuery.ajax({\n\t\t  \ttype: \"GET\",\n\t\t  \turl: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/gpx\/marathon2025_elev_distance.gpx\",\n\t\t  \tdataType: \"xml\",\n\t\t  \tsuccess: function(xml) {\n\t\t\t\tjQuery(xml).find(\"wpt\").each(function() {\n\t\t\t\tvar lat = jQuery(this).attr(\"lat\");\n\t\t\t\tvar lon = jQuery(this).attr(\"lon\");\n\t\t\t\tvar desc = jQuery(this).find('desc').text();\n\t\t\t\tvar distance = desc.substring(desc.length - 9);\n\t\t\t\tvar dist = parseFloat(distance).toFixed(1);\n\t\t\t\tif(dist%1 == 0){\n\t\t\t\t\tvar int = parseInt(distance);\n\t\t\t\tvar diff = Math.abs(parseFloat(distance) - parseFloat(int));\n\n\t\t\t\t\tif(dist in kms){\n\t\t\t\t\tconsole.log('key exists'+dist);\n\t\t\t\t\tconsole.log('diff is '+diff);\n\t\t\t\t\tif(diff < parseFloat(kms[dist].difference)) {\n\t\t\t\t\t\tconsole.log('saving diff');\n\t\t\t\t\t\tkms[dist] = {'distance': distance, 'coords' : '['+lat+','+lon+'],', 'difference': diff };\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tconsole.log('not saving diff bacause '+diff+' not larger than'+kms[dist].difference);\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tkms[dist] = {'distance': distance, 'coords' : '['+lat+','+lon+'],', 'difference': diff };\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tfor (var index in kms) {\n\t\t\t\t\tconsole.log(kms[index].coords);\t\t\t\t\n\t\t\t\t}\n\t    \t}\n\t\t});*\/\n\n        \/* Powerzone *\/\n        var pzArray = [[57.77848419025409, 14.170536725022126],\/\/Start\n            [57.778628099267515, 14.1963386747704],\/\/Liljeholmen\n            [57.78230160435722, 14.204830692017618],\/\/Sj\u00f6n\n            [57.77978822398305, 14.173033590220975],\/\/Lilsj\u00f6plan\n            \/\/[57.78195487651701, 14.195324972109566],\/\/ PurePower V\u00e4tterstranden\n            [57.78421908816135, 14.26395743151058]];\/\/Folkets Park\n        var pzLabels = [\n            'Startomr\u00e5de - uppv\u00e4rmning',\n            'TMG Taberg Power zone',\n            'Powerade Power zone',\n            'Mizuno Power zone',\n            'JLE AUDIO Power zone'];\n        var pzMarkersArray = [];\n        var pzInfoArray = [];\n\n        for (let x = 1; x <= pzArray.length; x++) {\n            var pzmarker = new google.maps.Marker({\n                position: new google.maps.LatLng(pzArray[parseInt(x-1)][0],pzArray[x-1][1]),\n                map: map,\n                icon: musicicon,\n                zIndex: 50 + x,\n                size: new google.maps.Size(30, 30)\n            });\n            pzMarkersArray.push(pzmarker);\n            var infowindow = new google.maps.InfoWindow();\n            infowindow.setContent(pzLabels[parseInt(x-1)]);\n            pzInfoArray.push(infowindow);\n            google.maps.event.addListener(pzMarkersArray[parseInt(x-1)], 'click', function() {\n                if( prev_infowindow ) {\n                    prev_infowindow.close();\n                }\n\n                prev_infowindow = pzInfoArray[parseInt(x-1)];\n                pzInfoArray[parseInt(x-1)].open(map, pzMarkersArray[parseInt(x-1)],false);\n            });\n        }\n        \/* V\u00e4xlingszone mara *\/\n        var stafettArray = [\n            [57.7843206430977, 14.263883462376967],\/\/km 10 b\u00e5de mara och halvmara\n            [57.79064481515766, 14.149699145870766],\/\/km 20\n            [57.781941517447635, 14.18965641196471]];\/\/km 30\n\n        var stafettLabels = [\n            'V\u00e4xlingszone stafett (Relay transition zone)',\n            'V\u00e4xlingszone stafett (Relay transition zone)',\n            'V\u00e4xlingszone stafett (Relay transition zone)'];\n        var stafettMarkersArray = [];\n        var stafettInfoArray = [];\n\n        for (let x = 1; x <= stafettArray.length; x++) {\n            var stafettmarker = new google.maps.Marker({\n                position: new google.maps.LatLng(stafettArray[parseInt(x-1)][0],stafettArray[x-1][1]),\n                map: map,\n                icon: stafetticon,\n                zIndex: 50 + x,\n                size: new google.maps.Size(30, 30)\n            });\n            stafettMarkersArray.push(stafettmarker);\n            var infowindow = new google.maps.InfoWindow();\n            infowindow.setContent(stafettLabels[parseInt(x-1)]);\n            stafettInfoArray.push(infowindow);\n            google.maps.event.addListener(stafettMarkersArray[parseInt(x-1)], 'click', function() {\n                if( prev_infowindow ) {\n                    prev_infowindow.close();\n                }\n\n                prev_infowindow = stafettInfoArray[parseInt(x-1)];\n                stafettInfoArray[parseInt(x-1)].open(map, stafettMarkersArray[parseInt(x-1)],false);\n            });\n        }\n        \/*Massage *\/\n        var massageArray = [[57.78225079922473, 14.20426968947875], \/\/sj\u00f6n\n            [57.77889833071345, 14.196909001894797],\/\/ liljeholmsparken\n            [57.766916740633114, 14.15371534567715]]; \/\/Munksj\u00f6tornet\n\n        var massageLabels = [\n            'PRO Athlete - idrottsmassage, akut omh\u00e4ndertagande och professionell tejpning',\n            'PRO Athlete - idrottsmassage, akut omh\u00e4ndertagande och professionell tejpning',\n            'PRO Athlete - idrottsmassage, akut omh\u00e4ndertagande och professionell tejpning'\n        ];\n        var massageMarkersArray = [];\n        var massageInfoArray = [];\n\n        for (let x = 1; x <= massageArray.length; x++) {\n            var massagemarker = new google.maps.Marker({\n                position: new google.maps.LatLng(massageArray[parseInt(x-1)][0],massageArray[x-1][1]),\n                map: map,\n                icon: massageicon,\n                zIndex: 50 + x,\n                size: new google.maps.Size(30, 30)\n            });\n            massageMarkersArray.push(massagemarker);\n            var infowindow = new google.maps.InfoWindow();\n            infowindow.setContent(massageLabels[parseInt(x-1)]);\n            massageInfoArray.push(infowindow);\n            google.maps.event.addListener(massageMarkersArray[parseInt(x-1)], 'click', function() {\n                if( prev_infowindow ) {\n                    prev_infowindow.close();\n                }\n\n                prev_infowindow = massageInfoArray[parseInt(x-1)];\n                massageInfoArray[parseInt(x-1)].open(map, massageMarkersArray[parseInt(x-1)],false);\n            });\n        }\n\n        \/*Duschar *\/\n        var duschArray = [[57.78242839633294, 14.205403981441068],\n            [57.79010074387414, 14.149754060267677]];\n\n        var duschLabels = [\n            'Dusch - \u00c5ngtv\u00e4ttbilen',\n            'Dusch - \u00c5ngtv\u00e4ttbilen'\n        ];\n        var duschMarkersArray = [];\n        var duschInfoArray = [];\n\n        for (let x = 1; x <= duschArray.length; x++) {\n            var duschmarker = new google.maps.Marker({\n                position: new google.maps.LatLng(duschArray[parseInt(x-1)][0],duschArray[x-1][1]),\n                map: map,\n                icon: duschicon,\n                zIndex: 50 + x,\n                size: new google.maps.Size(30, 30)\n            });\n            duschMarkersArray.push(duschmarker);\n            var infowindow = new google.maps.InfoWindow();\n            infowindow.setContent(duschLabels[parseInt(x-1)]);\n            duschInfoArray.push(infowindow);\n            google.maps.event.addListener(duschMarkersArray[parseInt(x-1)], 'click', function() {\n                if( prev_infowindow ) {\n                    prev_infowindow.close();\n                }\n\n                prev_infowindow = duschInfoArray[parseInt(x-1)];\n                duschInfoArray[parseInt(x-1)].open(map, duschMarkersArray[parseInt(x-1)],false);\n            });\n        }\n\n        \/* WC *\/\n        var wcArray = [[57.778496447962226, 14.170327393468027],\n            [57.77836495401469, 14.19686438771517]];\n\n        for (let x = 1; x <= wcArray.length; x++) {\n            var wcmarker = new google.maps.Marker({\n                position: new google.maps.LatLng(pzArray[parseInt(x-1)][0],pzArray[x-1][1]),\n                map: map,\n                icon: wcicon,\n                zIndex: x,\n                size: new google.maps.Size(30, 30)\n            });\n        }\n\n        \/* V\u00e4tskestationer *\/\n        var vsArray = [[57.77852200070473, 14.169852646222784],\/\/Start\n            [57.77850582094461, 14.196789417976088],\/\/Liljeholmen\n            [57.7839299042927, 14.26362132449349],\/\/Folkets Park\n            [57.78994389505676, 14.234603270240504], \/\/RC\n            [57.78261769693529, 14.206523200567263], \/\/Sj\u00f6n\n            [57.784238160228746, 14.167971000318696], \/\/Piren\n            [57.8059091218012, 14.1516713666723],\/\/Kortebo\n            [57.767342515568565, 14.153914861871625] \/\/Munksjotornet\n        ];\n        var vsLabels = [\n            'V\u00e4tskestation Start\/M\u00e5l',\n            'V\u00e4tskestation TMG Taberg:<br\/>Vatten, Umara sportdryck, saltgurka',\n            'V\u00e4tskestation:<br\/>Vatten, Umara sportdryck',\n            'V\u00e4tskestation:<br\/>Vatten, Umara sportdryck, banan',\n            'V\u00e4tskestation:<br\/>Vatten, Umara sportdryck',\n            'V\u00e4tskestation:<br\/>Vatten, Umara sportdryck',\n            'V\u00e4tskestation:<br\/>Vatten, Umara sportdryck, saltgurka',\n            'V\u00e4tskestation:<br\/>Vatten, Umara sportdryck, banan'\n        ];\n        var vsMarkersArray = [];\n        var vsInfoArray = [];\n\n        for (let x = 1; x <= vsArray.length; x++) {\n            var vsmarker = new google.maps.Marker({\n                position: new google.maps.LatLng(vsArray[parseInt(x-1)][0],vsArray[x-1][1]),\n                map: map,\n                icon: watericon,\n                zIndex: 100 + x,\n                size: new google.maps.Size(45, 30)\n            });\n            vsMarkersArray.push(vsmarker);\n            var infowindow = new google.maps.InfoWindow();\n            infowindow.setContent(vsLabels[parseInt(x-1)]);\n            vsInfoArray.push(infowindow);\n            google.maps.event.addListener(vsMarkersArray[parseInt(x-1)], 'click', function() {\n                if( prev_infowindow ) {\n                    prev_infowindow.close();\n                }\n\n                prev_infowindow = vsInfoArray[parseInt(x-1)];\n                vsInfoArray[parseInt(x-1)].open(map, vsMarkersArray[parseInt(x-1)],false);\n            });\n        }\n\n        \/\/Mini v\u00e4tskestation Qsys\n        var vsmarker2 = new google.maps.Marker({\n            position: new google.maps.LatLng(57.77414004052513, 14.17233199417747),\n            map: map,\n            icon: waterminiicon,\n            zIndex: 60,\n            size: new google.maps.Size(30, 30)\n        });\n        var infowindow2 = new google.maps.InfoWindow();\n        infowindow2.setContent('V\u00e4tskestation: vatten');\n        google.maps.event.addListener(vsmarker2, 'click', function() {\n            if( prev_infowindow ) {\n                prev_infowindow.close();\n            }\n\n            prev_infowindow = infowindow2;\n            infowindow2.open(map, vsmarker2);\n        });\n\t}\n\n\n\n\n\n\/\/ Takes an array of ElevationResult objects, draws the path on the map\n\/\/ and plots the elevation profile on a Visualization API ColumnChart.\n    \/*\nfunction plotElevation() {\n\tconst chartDiv = document.getElementById(\"elevation_chart\");\n\t\/\/ Create a new chart in the elevation_chart DIV.\n\tconst chart = new google.visualization.LineChart(chartDiv);\n\t\n\tconst data = new google.visualization.DataTable();\n\n\n\tsetTimeout(function(){\n\t\tdata.addColumn(\"string\", \"Distance\");\n\t\tdata.addColumn(\"number\", \"Elevation\");\n\t\tvar pointsperkm = parseInt(elevations.length\/42.2);\n\n\t\tfor (let i = 0; i < elevations.length; i++) {\n\t\t\tvar km = '';\n\t\t\tkm = String(parseInt(i\/pointsperkm));\n\t\t\tif(i%pointsperkm == 0){\n\n\t\t\t\tkm = String(parseInt(i\/pointsperkm));\n\t\t\t\tdata.addRow([km, elevations[i].elevation]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdata.addRow(['', elevations[i].elevation]);\n\t\t\t}\n\t\t\/\/data.addRow([km, elevations[i].elevation]);\n\t  }\n\n\t  \/\/ Draw the chart using the data within its DIV.\n\t  chart.draw(data, {\n\t    height: 150,\n\t    titleY: \"Elevation (m)\",\n\t    titleX: \"Distance\",\n\t    legend: \"none\",\n\t    colors: ['#5c8a9f'],\n\t    lineWidth: 5,\n\t    curveType: 'function',\n\t    chartArea:{left: 70 ,width:'100%'}\n\t  });\n\t  \/\/console.log('drawed chart');\n\n\t  google.visualization.events.addListener(chart, 'onmouseover', function(e) {\n\t        selectHandler(chart, e.row);\n\t   });\n\t},2000);\n}*\/\n\n\tvar elevmarker;\n  \tfunction selectHandler(chart, row) {\n  \t\tif (row != null) {\n      \t\tvar elevationMarker = new google.maps.LatLng(elevations[row].lat, elevations[row].lng);\n      \t\tconst icon = {\n\t\t\t    url: \"https:\/\/jonkopingmarathon.se\/wp-content\/themes\/square-child\/images\/elevation-marker.png\", \/\/ url\n\t\t\t    scaledSize: new google.maps.Size(17, 17), \/\/ scaled size\n\t\t\t    origin: new google.maps.Point(0,0), \/\/ origin\n\t\t\t    anchor: new google.maps.Point(8, 8) \/\/ anchor\n\t\t\t};\n\t\t\tif(elevmarker == null) {\n\t\t\t\televmarker = new google.maps.Marker({\n\t\t\t        position: elevationMarker,\n\t\t\t        map: map,\n\t\t\t        icon: icon,\n\t\t\t        zIndex: 100, \n\t\t\t        label: \"\",\n\t\t\t        size: new google.maps.Size(17, 17)\n\t\t\t    });\n\t\t\t}\n\t\t\telse {\n\t\t\t\televmarker.setPosition(elevationMarker);\n\t\t\t}\n\n    \t}\n  \t}\n    \/*\n  jQuery('#elevation_chart').mouseleave(function(e) {\n      if(elevmarker) {\n          elevmarker.setMap(null);\n          elevmarker = null;\n      }\n  });*\/\n\n    Chart.register( Chart.LineElement, Chart.LineController, Chart.Legend, Chart.Tooltip, Chart.LinearScale, Chart.PointElement, Chart.Filler, Chart.Title);\n\n    setTimeout(function() {\n        const ctx = document.getElementById(\"route-elevation-chart\").getContext(\"2d\");\n        const chartData = {\n            labels: distancesOnly, \/\/ this is test data\n            datasets: [{\n                data: elevationsOnly, \/\/ this is test data\n                fill: true,\n                borderColor: '#66ccff',\n                backgroundColor: '#66ccff66',\n                lineTension: 0.5,\n                pointRadius: 1,\n                spanGaps: true\n            }]\n        };\n        const config = {\n            type: 'line',\n            data: chartData,\n            plugins: [{\n                beforeInit: (chart, args, options) => {\n                    const maxHeight = Math.max(...chart.data.datasets[0].data);\n                    chart.options.scales.x.min = 0;\n                    chart.options.scales.x.max = 42.2;\n                    chart.options.scales.y.min = 50;\/\/maxHeight + Math.round(maxHeight * 0.1);\n                    chart.options.scales.y.max = 300;\/\/maxHeight + Math.round(maxHeight * 0.1);\n                }\n            },\n                {\n                    id: 'myEventCatcher',\n                    beforeEvent(chart, args, pluginOptions) {\n                        const event = args.event;\n                        if (event.type === 'mousemove') {\n                            selectHandler(chart, selectedPoint);\n                        }\n                    }\n                }],\n            options: {\n                animation: false,\n                maintainAspectRatio: false,\n                interaction: { intersect: false, mode: 'index' },\n                tooltip: { position: 'nearest' },\n                responsive: true,\n                scales: {\n                    x: {type: 'linear'},\n                    y: {type: 'linear', beginAtZero: false}\n                },\n                events: ['mousemove'],\n                plugins: {\n                    title: {align: \"end\", display: true, text: \"Distance, km \/ Elevation, m\"},\n                    legend: {display: false},\n                    tooltip: {\n                        displayColors: false,\n                        callbacks: {\n                            title: (tooltipItems) => {\n                                return \"Distance: \" + tooltipItems[0].label + 'km'\n                            },\n                            label: (tooltipItem) => {\n                                return \"Elevation: \" + tooltipItem.raw + 'm'\n                            },\n                            afterBody: (data) => {\n                                if(data && data[0])\n                                    selectedPoint = data[0].dataIndex;\n                                return [''];\n                            }\n                        }\n                    }\n                }\n            }\n        };\n\n        const chart = new Chart(ctx, config);\n\n        jQuery('#route-elevation-chart').mouseleave(function(e) {\n            if(elevmarker) {\n                elevmarker.setMap(null);\n                elevmarker = null;\n            }\n        });\n\n    },2000);\n\n\n\n\t  \t\/*var mapLayer = new google.maps.KmlLayer({\n\t    url: \"https:\/\/www.google.com\/maps\/d\/kml?mid=1TwkvZA_5r67r2f9AJ9xMw9M77evlQq2D&dummy=\"+(new Date()).getTime()});\n\t  \tmapLayer.setMap(map);*\/\n\n\t\t\n\n \n<\/script>\n<script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?key=AIzaSyCih0vmRdehLpvBvWTbn472_XCW-X186eU&callback=jmMap&?v=3.8\"><\/script>\n\n<p>Tip: hover your mouse over the track profile to see which area of the track the profile applies to. Click on the water stations to see what will be served there. Click on the kilometre markers to see the times the runners pass.<\/p>\n\n<p><strong>Please note that minor adjustments may be made due to ongoing renovations.<\/strong><\/p>\n\n<h2 class=\"wp-block-heading\">Elevation profile<\/h2>\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/wp-content\/uploads\/2022\/07\/elevation-marathon_2021vs2022_nologo.jpg\" alt=\"Elevation profile J&#xF6;nk&#xF6;ping Half Marathon\"\/><\/figure>\n\n<p>Here you can download <a href=\"https:\/\/jonkopingmarathon.se\/wp-content\/uploads\/2022\/08\/karta-marathon-web.pdf\" target=\"_blank\" rel=\"noopener\">the map as a PDF<\/a> or as a <a href=\"https:\/\/jonkopingmarathon.se\/wp-content\/uploads\/2024\/08\/marathon2024.gpx\">GPX file<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In 2022, we redrew the marathon course. Fewer vertical metres but still a lot of beautiful views along our beautiful city. A varied course profile with beautiful scenery and supportive crowds along the course. Have you set a personal best on the old track? Then you&#8217;ll love the new route! Distance: 42,195 metersHydration stations: 12 [&#8230;]<\/p>\n","protected":false},"author":17,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-41942","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Map Marathon - J\u00f6nk\u00f6ping Marathon<\/title>\n<meta name=\"description\" content=\"This year we redesigned the marathon course - less elevation gain with beautiful views along V\u00e4ttern, Huskvarna and J\u00f6nk\u00f6ping.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Map Marathon - J\u00f6nk\u00f6ping Marathon\" \/>\n<meta property=\"og:description\" content=\"This year we redesigned the marathon course - less elevation gain with beautiful views along V\u00e4ttern, Huskvarna and J\u00f6nk\u00f6ping.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/\" \/>\n<meta property=\"og:site_name\" content=\"J\u00f6nk\u00f6ping Marathon\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/stadenarredo\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-29T07:30:08+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/map-marathon\\\/\",\"url\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/map-marathon\\\/\",\"name\":\"Map Marathon - J\u00f6nk\u00f6ping Marathon\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/#website\"},\"datePublished\":\"2022-04-24T18:19:55+00:00\",\"dateModified\":\"2024-10-29T07:30:08+00:00\",\"description\":\"This year we redesigned the marathon course - less elevation gain with beautiful views along V\u00e4ttern, Huskvarna and J\u00f6nk\u00f6ping.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/map-marathon\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/map-marathon\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/map-marathon\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Start\",\"item\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Map Marathon\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/\",\"name\":\"J\u00f6nk\u00f6ping Marathon\",\"description\":\"jonkopingmarathon.se\",\"publisher\":{\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/#organization\",\"name\":\"J\u00f6nk\u00f6ping Marathon\",\"url\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/jonkopingmarathon.se\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/OG_IMAGE_JonkopingMarathon.jpg\",\"contentUrl\":\"https:\\\/\\\/jonkopingmarathon.se\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/OG_IMAGE_JonkopingMarathon.jpg\",\"width\":1200,\"height\":630,\"caption\":\"J\u00f6nk\u00f6ping Marathon\"},\"image\":{\"@id\":\"https:\\\/\\\/jonkopingmarathon.se\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/stadenarredo\",\"https:\\\/\\\/www.instagram.com\\\/jonkopingmarathon\\\/\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCbXk-FxL8Z1K_OdthfGt-YA\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Map Marathon - J\u00f6nk\u00f6ping Marathon","description":"This year we redesigned the marathon course - less elevation gain with beautiful views along V\u00e4ttern, Huskvarna and J\u00f6nk\u00f6ping.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/","og_locale":"en_US","og_type":"article","og_title":"Map Marathon - J\u00f6nk\u00f6ping Marathon","og_description":"This year we redesigned the marathon course - less elevation gain with beautiful views along V\u00e4ttern, Huskvarna and J\u00f6nk\u00f6ping.","og_url":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/","og_site_name":"J\u00f6nk\u00f6ping Marathon","article_publisher":"https:\/\/www.facebook.com\/stadenarredo","article_modified_time":"2024-10-29T07:30:08+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/","url":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/","name":"Map Marathon - J\u00f6nk\u00f6ping Marathon","isPartOf":{"@id":"https:\/\/jonkopingmarathon.se\/en\/#website"},"datePublished":"2022-04-24T18:19:55+00:00","dateModified":"2024-10-29T07:30:08+00:00","description":"This year we redesigned the marathon course - less elevation gain with beautiful views along V\u00e4ttern, Huskvarna and J\u00f6nk\u00f6ping.","breadcrumb":{"@id":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jonkopingmarathon.se\/en\/map-marathon\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jonkopingmarathon.se\/en\/map-marathon\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Start","item":"https:\/\/jonkopingmarathon.se\/en\/"},{"@type":"ListItem","position":2,"name":"Map Marathon"}]},{"@type":"WebSite","@id":"https:\/\/jonkopingmarathon.se\/en\/#website","url":"https:\/\/jonkopingmarathon.se\/en\/","name":"J\u00f6nk\u00f6ping Marathon","description":"jonkopingmarathon.se","publisher":{"@id":"https:\/\/jonkopingmarathon.se\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jonkopingmarathon.se\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jonkopingmarathon.se\/en\/#organization","name":"J\u00f6nk\u00f6ping Marathon","url":"https:\/\/jonkopingmarathon.se\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jonkopingmarathon.se\/en\/#\/schema\/logo\/image\/","url":"https:\/\/jonkopingmarathon.se\/wp-content\/uploads\/2024\/01\/OG_IMAGE_JonkopingMarathon.jpg","contentUrl":"https:\/\/jonkopingmarathon.se\/wp-content\/uploads\/2024\/01\/OG_IMAGE_JonkopingMarathon.jpg","width":1200,"height":630,"caption":"J\u00f6nk\u00f6ping Marathon"},"image":{"@id":"https:\/\/jonkopingmarathon.se\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/stadenarredo","https:\/\/www.instagram.com\/jonkopingmarathon\/","https:\/\/www.youtube.com\/channel\/UCbXk-FxL8Z1K_OdthfGt-YA"]}]}},"_links":{"self":[{"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/pages\/41942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/comments?post=41942"}],"version-history":[{"count":2,"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/pages\/41942\/revisions"}],"predecessor-version":[{"id":55519,"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/pages\/41942\/revisions\/55519"}],"wp:attachment":[{"href":"https:\/\/jonkopingmarathon.se\/en\/wp-json\/wp\/v2\/media?parent=41942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}