{"id":831,"date":"2010-11-17T13:03:39","date_gmt":"2010-11-17T11:03:39","guid":{"rendered":"http:\/\/sickel.net\/blogg\/?p=831"},"modified":"2012-07-05T21:39:30","modified_gmt":"2012-07-05T19:39:30","slug":"legend-in-kml-files","status":"publish","type":"post","link":"http:\/\/sickel.net\/blogg\/?p=831","title":{"rendered":"Legend in kml-files"},"content":{"rendered":"<p>I am making .kml-files to visualize measurements. I have defined a few styles and depending on the level of a given parameter, the points are plotted with different colors. The legend is put in the file-level description of the kml-file. Here I have used a &lt;ul&gt; to get the points for the legend. Each &lt;li&gt; has a specific style to have the right color on the dot. To avoid having the text in the same color, the text within the li is put in a &lt;span&gt; having the color set to black. <\/p>\n<p>e.g:<\/p>\n<pre>&lt;li style=\"color:#ff0000\"&gt;\r\n    &lt;span style=\"color:#000000\"&gt;&amp;gt; 6000&lt;\/span&gt;\r\n&lt;\/li&gt;<\/pre>\n<p>gives this text:<\/p>\n<ul>\n<li style=\"color:#ff0000; list-style-type:disc;\"><span style=\"color:#000000\">&gt; 6000<\/span><\/li>\n<\/ul>\n<p>An example kml file can be downloaded from <a href=\"\/div\/mobilpoint-154.kml\">here<\/a>. The php-file used for creating the kml-file is <a href=\"\/div\/kml_points.txt\">here<\/a>. The latter file is made for a specific apllication, but I hope it may work as a starting point for others. And &#8211; yes I know how to do oop in php, but I did not find it useful in this fairly simple script. The legend may also be put into some kind of overlay on the kml. More investigations to be done.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to trick with css to get different colored item markers and black text in a ul <a href=\"http:\/\/sickel.net\/blogg\/?p=831\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[32,23],"tags":[],"class_list":["post-831","post","type-post","status-publish","format-standard","hentry","category-css","category-kml"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pnVtD-dp","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts\/831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=831"}],"version-history":[{"count":7,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts\/831\/revisions"}],"predecessor-version":[{"id":1304,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=\/wp\/v2\/posts\/831\/revisions\/1304"}],"wp:attachment":[{"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=831"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=831"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/sickel.net\/blogg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}