

{"id":3354,"date":"2018-08-09T23:03:33","date_gmt":"2018-08-10T06:03:33","guid":{"rendered":"http:\/\/gothein.de\/reiseblog\/?p=3354"},"modified":"2018-08-25T03:20:02","modified_gmt":"2018-08-25T10:20:02","slug":"programmtest-gpx-upload","status":"publish","type":"post","link":"https:\/\/gothein.de\/reiseblog\/2018\/08\/09\/programmtest-gpx-upload\/","title":{"rendered":"Programmtest GPX Upload"},"content":{"rendered":"<p>Auf einer l\u00e4ngeren Zugfahrt hatte ich die Zeit ein kleines Programm zu schreiben welches es erm\u00f6glicht eine GPX Datei auf den Server hochzuladen und dann automatisch den Mittelpunkt zu errechnen und den Zoom Level der OSM Karte zu bestimmen. Daraufhin wird dann der Shortcode f\u00fcr das OSM Plugin f\u00fcr WordPress erzeugt. Dieser Code kann dann per &#8222;Kopieren\/Einf\u00fcgen&#8220; direkt in den Blog Eintrag kopiert werden. So sieht das aus. Test-Tour mit meinem Randoneur zun\u00e4chst auf den Wei\u00dfen Stein \u00fcber Teer und Schotter und dann noch hoch zum K\u00f6nigsstuhl, ebenfalls von Blockhaus \u00fcber Wald-Schotterweg.<br \/>\n\n        <div id=\"map_ol3js_1\"\n             class=\"map undefined\"\n             data-map_name=\"undefined\"\n             data-map=\"map_ol3js_1\"\n             style=\"width:100%;\n                    max-width:100%;\n                    height:450px;\n                    display:block;\n                    overflow:hidden;\n                    border:2px solid grey;\">\n          <div id=\"map_ol3js_1_popup\" class=\"ol-popup\">\n            <a href=\"#\" id=\"map_ol3js_1_popup-closer\" class=\"ol-popup-closer\"><\/a>\n            <div id=\"map_ol3js_1_popup-content\"><\/div>\n          <\/div>\n        <\/div>\n    \n\n\t\t\t\t<script type=\"text\/javascript\">\n\t\t\t\t\ttranslations['openlayer'] = \"open layer\";\n\t\t\t\t\ttranslations['openlayerAtStartup'] = \"open layer at startup\";\n\t\t\t\t\ttranslations['generateLink'] = \"Der Link zur Karte mit ausgew\u00e4hlten Overlays und angezeigtem Ausschnitt\";\n\t\t\t\t\ttranslations['shortDescription'] = \"Kurzbeschreibung\";\n\t\t\t\t\ttranslations['generatedShortCode'] = \"to get a text control link paste this code in your wordpress editor\";\n\t\t\t\t\ttranslations['closeLayer'] = \"close layer\";\n\t\t\t\t\ttranslations['cantGenerateLink'] = \"put this string in the existing map short code to control this map\";\n\t\t\t  <\/script>\n\n\n\t\t\t  <script type=\"text\/javascript\">\n\t\t\t  vectorM['map_ol3js_1'] = [];\n\t        \n        var raster = getTileLayer(\"osm\",\"NoKey\");\t\t\t\n\n\t\t\t  var map_ol3js_1 = new ol.Map({\n\t\t\t\tinteractions: ol.interaction.defaults.defaults({mouseWheelZoom:false}),\n\t\t\t\tlayers: [raster],\n\t\t\t\ttarget: \"map_ol3js_1\",\n\t\t\t\tview: new ol.View({\n\t\t\t\t  center: ol.proj.transform([8.717741,49.405506], \"EPSG:4326\", \"EPSG:3857\"),\n\t\t\t\t  zoom: 11.453220\n\t\t\t\t})\n\t\t\t  });\n\t\t\t  \n    var style0 = {\n      \"Point\": [new ol.style.Style({\n\n          image: new ol.style.Icon({\n            anchor: [0.5, 41],\n            anchorXUnits: \"fraction\",\n            anchorYUnits: \"pixels\",\n            opacity: 0.75,\n            src: \"https:\/\/gothein.de\/reiseblog\/wp-content\/plugins\/osm\/icons\/mic_blue_pinother_02.png\"\n          })\n      })],\n\n      \"LineString\": [new ol.style.Style({\n        stroke: new ol.style.Stroke({\n          color: \"blue\",\n          width: 8\n        })\n      })],\n      \"MultiLineString\": [new ol.style.Style({\n        stroke: new ol.style.Stroke({\n          color: \"blue\",\n          width: 4\n        })\n      })]\n    };\n\t\t  var vectorL0 = new ol.layer.Vector({\n\t\t\t\tsource: new ol.source.Vector({\n\t\t\t\turl:\"\/reiseblog\/wp-content\/uploads\/gpx\/test2.gpx\",\n\t\t\t\tformat: new ol.format.GPX({\n\t\t\t\t\textractStyles: false\n\t\t\t\t})\n\t\t\t}),\n\t\t\tzIndex: 92,\n\t\t\tstyle: function(feature, resolution) {return style0[feature.getGeometry().getType()];}\n\t\t  });\n\t\t  map_ol3js_1.addLayer(vectorL0);addControls2Map(map_ol3js_1,0,0,3,1,5,6,7,0,1);\nosm_addPopupClickhandler(map_ol3js_1,  \"map_ol3js_1\"); \nosm_addMouseHover(map_ol3js_1); <\/script><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3358 alignnone size-full\" src=\"https:\/\/gothein.de\/reiseblog\/wp-content\/uploads\/2018\/08\/img_20180706_1545176473567525314426566.jpg\" width=\"3000\" height=\"2250\" srcset=\"https:\/\/gothein.de\/reiseblog\/wp-content\/uploads\/2018\/08\/img_20180706_1545176473567525314426566.jpg 3000w, https:\/\/gothein.de\/reiseblog\/wp-content\/uploads\/2018\/08\/img_20180706_1545176473567525314426566-300x225.jpg 300w, https:\/\/gothein.de\/reiseblog\/wp-content\/uploads\/2018\/08\/img_20180706_1545176473567525314426566-768x576.jpg 768w, https:\/\/gothein.de\/reiseblog\/wp-content\/uploads\/2018\/08\/img_20180706_1545176473567525314426566-1024x768.jpg 1024w\" sizes=\"auto, (max-width: 3000px) 100vw, 3000px\" \/><\/p>\n<p>Der Blick vom K\u00f6nigsstuhl<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Auf einer l\u00e4ngeren Zugfahrt hatte ich die Zeit ein kleines Programm zu schreiben welches es erm\u00f6glicht eine GPX Datei auf den Server hochzuladen und dann automatisch den Mittelpunkt zu errechnen und den Zoom Level der OSM Karte zu bestimmen. Daraufhin wird dann der Shortcode f\u00fcr das OSM Plugin f\u00fcr WordPress erzeugt. Dieser Code kann dann [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3354","post","type-post","status-publish","format-standard","hentry","category-allgemein"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/posts\/3354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/comments?post=3354"}],"version-history":[{"count":0,"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/posts\/3354\/revisions"}],"wp:attachment":[{"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/media?parent=3354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/categories?post=3354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gothein.de\/reiseblog\/wp-json\/wp\/v2\/tags?post=3354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}