Newbie
July 2019 - Aug 2, 2019 0:04:57 GMT
|
Post by dcpeter on Jul 27, 2019 20:38:48 GMT
Hello,
I need to create a KML file with different placemarks. Is it possible to define the placemark with an icon style that can show something like a dot but does not require a file name or URL to an icon. The problem is that the KML file cannot reference an icon file since it will be viewed by users on their own desktop. It also cannot reference a URL since it may be possible that any given URL will not be accessible from the user's desktop. I am looking for something that some mapping APIs use where you can use keywords that the API knows about rather than listing a URL. I would like to believe that GoogleEarth as an application can understand how to draw a blue dot, for example, without having to have a URL to a blue dot icon.
Any thoughts?
Thanks - Peter
|
|
March 2015 - Jan 23, 2023 9:58:32 GMT
|
Post by Admin on Jul 28, 2019 4:53:48 GMT
Have you read This PostThe section on Folders may help you.
|
|
Newbie
July 2019 - Aug 2, 2019 0:04:57 GMT
|
Post by dcpeter on Jul 29, 2019 1:43:02 GMT
Thanks for the reply. Not sure if I follow, however. The part on the folders from the post simply gives instructions on how to move existing points to a new folder. I am looking for a way to designate a point's "icon" with something that doesn't require a URL or file reference. A simple colored dot, for example.
|
|
March 2015 - Jan 23, 2023 9:58:32 GMT
|
Post by Admin on Jul 29, 2019 5:08:58 GMT
OK, I think I get what you're after now. Click on the "ringed" areas in the pictures to get to the icons, then you can choose one or have the option to add from you're computer.
|
|
Cartographer
April 2015 - Apr 23, 2024 4:32:27 GMT
|
Post by washi on Jul 29, 2019 9:39:16 GMT
dcpeter, Your question interests me. First of all, as I understand it, it seems like it might be possible to define an icon within the code for a placemark, but it would be pointless, because if Google Earth could be made to function at all without the vast amount of image data it is constantly downloading from an internet connection, it would have severely limited functionality, basically not worth even trying. A placemark, like all of ready-built tools (say like an image overlay, for example) is a pre-written file in the Keyhole Markup Language, into which the user has convenient access to alter some of the data (latitude, longitude, view angle, etc., etc.). Other data is possible, but cannot be entered with the pre-written tools. (If you want to search through files I have posted in this forum, you can find many examples where I have changed the color of the text balloons in placemarks, etc.) This was done by editing the pre-written placemarks, etc., with a text editor. The pre-written placemark tool allows for the creation of a placemark without an icon. Let me show you what two placemarks, one with an icon, one without, look like when viewed in a text editor: (Examine the <IconStyle>...</IconStyle> sections in the two example below.) Normal Placemark With Icon
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>KmlFile</name>
<Style id="s_ylw-pushpin_hl">
<IconStyle>
<scale>1.3</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<Style id="s_ylw-pushpin">
<IconStyle>
<scale>1.1</scale>
<Icon>
<href>http://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png</href>
</Icon>
<hotSpot x="20" y="2" xunits="pixels" yunits="pixels"/>
</IconStyle>
</Style>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#s_ylw-pushpin_hl</styleUrl>
</Pair>
</StyleMap>
<Placemark>
<name>Test Placemark</name>
<LookAt>
<longitude>-121.5862603075616</longitude>
<latitude>36.99742091473841</latitude>
<altitude>0</altitude>
<heading>-1.904261698885837e-010</heading>
<tilt>0</tilt>
<range>1315.683158671483</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<styleUrl>#m_ylw-pushpin</styleUrl>
<Point>
<gx:drawOrder>1</gx:drawOrder>
<coordinates>-121.5862603075616,36.99742091473841,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
Normal Placemark Except The User Has Elected To Have No Icon<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>KmlFile</name>
<Style id="s_ylw-pushpin">
<IconStyle>
<Icon>
</Icon>
</IconStyle>
<ListStyle>
</ListStyle>
</Style>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
<key>highlight</key>
<styleUrl>#s_ylw-pushpin_hl</styleUrl>
</Pair>
</StyleMap>
<Style id="s_ylw-pushpin_hl">
<IconStyle>
<Icon>
</Icon>
</IconStyle>
<ListStyle>
</ListStyle>
</Style>
<Placemark>
<name>Test 2 Placemark</name>
<LookAt>
<longitude>-121.5868255623513</longitude>
<latitude>36.9974035497303</latitude>
<altitude>0</altitude>
<heading>-0.0003401539818168613</heading>
<tilt>0</tilt>
<range>1314.886736365548</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<styleUrl>#m_ylw-pushpin</styleUrl>
<Point>
<gx:drawOrder>1</gx:drawOrder>
<coordinates>-121.5868255623513,36.9974035497303,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>
The significant difference between the 1st and 2nd example is the URL from where the URL where the image data is stored. (Other differences derive from the fact that the second example has no need to define what the Icon looks like when clicked, its display size, and the region sensitive to a mouse click.) I am thinking that there should be no reason why one couldn't replace the URL with the raw image data. Frankly, I haven't considered much what image data looks like since the bone age when I was redefining characters and sprints on my old Commodore 64, but I am reasonably certain that all image data is still made up of arrays of 1's and 0's, and if you could figure out an acceptable pattern, you should be able to edit it into the KML for a placemark. It would be useless, as I have said, without access to online GE image data, and the data for even the simplest icon would vastly increase the size of the placemark file.
|
|