0

I've written a .kml file that includes some points and lines, and when imported to Google My Maps, everything is displayed. However, when viewed in Google Map on my Android device (Select from Google Maps - More settings - Your Places - Maps), points are not displayed at all. Is there anythinig wrong with the kml file, and how can I view points on Android devices as well?

Screenshots of Google Map from both desktop and Android are posted below. KML on Google Map Desktop KML on Google Map Android

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document id="raptor">
        <name>Raptor.kml</name>
        <visibility>1</visibility>
        <open>1</open>

        <Placemark id="start">
            <name>Start</name>
            <Point id="startpoint">
                <coordinates>
                    0.16212,51.5454
                </coordinates>
            </Point>
        </Placemark>
        <Placemark id="target">
            <name>Target</name>
            <Point id="targetpoint">
                <coordinates>
                    0.06146,51.5529
                </coordinates>
            </Point>
        </Placemark>
        <Placemark id="route">
            <name>Route</name>
            <LineString id="routelines">
                <coordinates>
                    0.16212,51.5454
                    0.16619,51.5445
                    0.16553,51.5442
                    0.05228,51.5394
                    0.05113,51.5381
                    0.0589,51.5528
                    0.06146,51.5529
                </coordinates>
            </LineString>
        </Placemark>
    </Document>
</kml>
Andrew
  • 3
  • 2
  • Your KML looks fine and passes validation. The only thing I can think of is that maybe GMaps for Android isn't applying a default style to the points? ... maybe try adding explicit icon styles to your KML placemarks, and see if that helps? – Christiaan Adams Aug 19 '19 at 15:59
  • You're right, by adding a style to the point it shows correctly on the mobile app, thank you very much :D – Andrew Aug 19 '19 at 20:09

1 Answers1

0

The problem is solved. By adding a style to the point, it shows correctly on the mobile app as well. Below is the modified code that adds style and screenshot. Point on Google Map Android

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Document id="raptor">
        <name>points.kml</name>
        <Style id="sn_blue-dot_copy3">
            <IconStyle>
                <Icon>
                    <href>http://www.google.com/intl/en_us/mapfiles/ms/icons/blue-dot.png</href>
                </Icon>
            </IconStyle>
        </Style>
        <visibility>1</visibility>
        <open>1</open>
        <Placemark id="start">
            <name>Start</name>
            <styleUrl>#sn_blue-dot_copy3</styleUrl>
            <Point id="startpoint">
                <coordinates>
                    0.16212,51.5454,0
                </coordinates>
            </Point>
        </Placemark>
        <Placemark id="target">
            <name>Target</name>
            <styleUrl>#sn_blue-dot_copy3</styleUrl>
            <Point id="targetpoint">
                <coordinates>
                    0.06146,51.5529,0
                </coordinates>
            </Point>
        </Placemark>
        <Placemark id="route">
            <name>Route</name>
            <LineString id="routelines">
                <coordinates>
                    0.16212,51.5454
                    0.16619,51.5445
                    0.16553,51.5442
                    0.05228,51.5394
                    0.05113,51.5381
                    0.0589,51.5528
                    0.06146,51.5529
                </coordinates>
            </LineString>
        </Placemark>
    </Document>
</kml>
Andrew
  • 3
  • 2
  • One additional thing you may want to try adding is a "hotspot" tag for the icons, so that they are anchored by the bottom of the icon instead of the center. The default is the center, which works for round icons, but not for "placemark" style icons like you're using. I'm not sure if it will work on Android, but after , try adding – Christiaan Adams Aug 20 '19 at 15:20