{"id":1395,"date":"2023-04-15T04:03:53","date_gmt":"2023-04-15T04:03:53","guid":{"rendered":"https:\/\/www.cartograph.eu\/v3\/?p=1395"},"modified":"2023-04-15T04:08:20","modified_gmt":"2023-04-15T04:08:20","slug":"using-kml-networklink-in-cartograph-maps-as-online-overlays","status":"publish","type":"post","link":"https:\/\/www.cartograph.eu\/v3\/using-kml-networklink-in-cartograph-maps-as-online-overlays\/","title":{"rendered":"Using KML NetworkLink tags in Cartograph Maps for online overlays"},"content":{"rendered":"\n<p>Cartograph Maps supports <a rel=\"noreferrer noopener\" href=\"https:\/\/developers.google.com\/kml\/documentation\/kmlreference\" data-type=\"post\" target=\"_blank\">KML ovlerays <\/a>containing <strong>tracks<\/strong>, <strong>waypoints<\/strong>, and <strong>shapes <\/strong>(<strong>polygons<\/strong>). Usually all data is contained in a static KML or KMZ file which is saved locally on the device. <\/p>\n\n\n\n<p>But imagine a scenario where you want to dynamically pull information from a remote server and show it on the map, for instance, for showing the driver&#8217;s positions in fleet management or the participant&#8217;s positions during a sport event.<\/p>\n\n\n\n<p>KML offers <strong>NetworkLink <\/strong>tags for <strong>pulling data from remote servers <\/strong>(<a rel=\"noreferrer noopener\" href=\"https:\/\/www.google.com\/earth\/outreach\/learn\/using-network-links-effectively\/\" target=\"_blank\">click here for a Google article <\/a>with more details about the usage of NetworkLink tags). In the following Sections we will discuss how to use KML NetworkLink tags in Cartograph Maps.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Create the KML file<\/h2>\n\n\n\n<p>First, we create a KML file which contains the <a href=\"https:\/\/developers.google.com\/kml\/documentation\/kmlreference#networklink\" target=\"_blank\" rel=\"noreferrer noopener\">NetworkLink tag <\/a>which points to your server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version='1.0' ?&gt;\n&lt;kml\n\txmlns=\"http:\/\/www.opengis.net\/kml\/2.2\"&gt;\n\t&lt;Document&gt;\n\t\t&lt;name&gt;Example KML file&lt;\/name&gt;\n\t\t&lt;NetworkLink&gt;\n\t\t\t&lt;name&gt;Fleet management server&lt;\/name&gt;\n\t\t\t&lt;Link&gt;\n\t\t\t\t&lt;href&gt;https:\/\/fleetdata.myserver.com&lt;\/href&gt;\n\t\t\t\t&lt;viewFormat&gt;south=&#91;bboxSouth]&amp;amp;west=&#91;bboxWest]&amp;amp;north=&#91;bboxNorth]&amp;amp;east=&#91;bboxEast]&lt;\/viewFormat&gt;\n\t\t\t\t&lt;viewRefreshMode&gt;onStop&lt;\/viewRefreshMode&gt;\n\t\t\t&lt;\/Link&gt;\n\t\t&lt;\/NetworkLink&gt;\n\t&lt;\/Document&gt;\n&lt;\/kml&gt;\n\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Add the KML file to Cartograph Maps<\/h2>\n\n\n\n<p>Go to the <a href=\"https:\/\/www.cartograph.eu\/v3\/overlay-manager\/\" data-type=\"post\" data-id=\"1058\">Overlay manager <\/a>&#8211; &#8220;Overlays&#8221; &#8211; &#8220;+&#8221; &#8211; &#8220;<strong>Import KML\/KMZ overlay<\/strong>&#8221; and select the KML file created above. Cartograph Maps will now load the live data from your server and show it on the map.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cartograph Maps supports KML ovlerays containing tracks, waypoints, and shapes (polygons). Usually all data is contained in a static KML<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1395","post","type-post","status-publish","format-standard","hentry","category-help"],"_links":{"self":[{"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/posts\/1395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/comments?post=1395"}],"version-history":[{"count":9,"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/posts\/1395\/revisions"}],"predecessor-version":[{"id":1407,"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/posts\/1395\/revisions\/1407"}],"wp:attachment":[{"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/media?parent=1395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/categories?post=1395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cartograph.eu\/v3\/wp-json\/wp\/v2\/tags?post=1395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}