

{"id":7,"date":"2024-03-06T17:56:18","date_gmt":"2024-03-06T16:56:18","guid":{"rendered":"https:\/\/solarxbike.se\/labbet\/zon4\/?page_id=7"},"modified":"2024-03-06T17:57:09","modified_gmt":"2024-03-06T16:57:09","slug":"exempel-kml","status":"publish","type":"page","link":"https:\/\/solarxbike.se\/labbet\/zon4\/exempel-kml\/","title":{"rendered":"Exempel kml"},"content":{"rendered":"\n\n\n\t\t\t\t<div id=\"map_ol3js_1\" class=\"map undefined\" data-map_name=\"undefined\" data-map=\"map_ol3js_1\" style=\"width:100%; max-width:100%; height:450px; display:block; overflow:hidden;border:2px solid grey;\" >\n\t\t\t\t  <div id=\"map_ol3js_1_popup\" class=\"ol-popup\" >\n\t\t\t\t\t<a href=\"#\" id=\"map_ol3js_1_popup-closer\" class=\"ol-popup-closer\"><\/a>\n\t\t\t\t\t<div id=\"map_ol3js_1_popup-content\" ><\/div>\n\t\t\t\t  <\/div>\n\t\t\t\t<\/div>\n\t\t\t\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'] = \"l\u00e4nk till denna karta med \u00f6ppna lager\";\n\t\t\t\t\ttranslations['shortDescription'] = \"kort beskrivning\";\n\t\t\t\t\ttranslations['generatedShortCode'] = \"f\u00f6r att f\u00e5 en textkontroll l\u00e4nk klistra in denna kod i din 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([6.378,58.213], \"EPSG:4326\", \"EPSG:3857\"),\n\t\t\t\t  zoom: 9\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:\/\/solarxbike.se\/labbet\/zon4\/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: \"none\",\n          width: 8\n        })\n      })],\n      \"MultiLineString\": [new ol.style.Style({\n        stroke: new ol.style.Stroke({\n          color: \"none\",\n          width: 4\n        })\n      })]\n    };\n\t\t  vectorL0 = new ol.layer.Vector({\n\n\t\t\tsource: new ol.source.Vector({\n\t\t  url:\"https:\/\/solarxbike.se\/labbet\/zon4\/wp-content\/plugins\/osm\/examples\/MarkerSample.kml\",\n\t\t\t  format: new ol.format.KML({ showPointNames: false})\n\t\t\t}),\n         zIndex: 92\n\t\t  });map_ol3js_1.addLayer(vectorL0);\n      var extension1 = ol.extent.createEmpty();\n      var curZoom1 = map_ol3js_1.getView().getZoom();\n\n      map_ol3js_1.getLayers().forEach(function(layer){\n         if(!layer.get(\"id\")) {     \n            layer.once(\"change\", function(e){\n               ol.extent.extend(extension1, (layer.getSource().getExtent()));\n               map_ol3js_1.getView().fit(extension1, {padding: [50, 50, 50, 50]});\n            });\n         }\n      });\n\n    \naddControls2Map(map_ol3js_1,0,0,3,0,5,6,7,0,1);\nosm_addPopupClickhandler(map_ol3js_1,  \"map_ol3js_1\"); \nosm_addMouseHover(map_ol3js_1); <\/script>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-7","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/pages\/7","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":1,"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/pages\/7\/revisions"}],"predecessor-version":[{"id":8,"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/pages\/7\/revisions\/8"}],"wp:attachment":[{"href":"https:\/\/solarxbike.se\/labbet\/zon4\/wp-json\/wp\/v2\/media?parent=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}