0

SOとGoogleを検索しましたが、これに関する回答は見つかりませんでした。

次のデータが渡されているので、Androidで表示する必要があります。 http://maps.google.com/maps/ms?msid=214791092532835797516.0004bc20df4e3c6ddf92a&msa=0&ll=52.812827,-2.079865&spn=0.003761,0.011689&

現在、IFrameを唯一の要素としてWebビューに表示しています。しかし、私は本当にそれをMapViewに表示する必要があります。MapViewを作成し、動作させました。上記のURLに示すように、MapViewにデータを表示する必要があります。

緯度/経度の値を確認できますが、カスタムマップを取得して、MapViewに追加することはできますか?

4

1 に答える 1

1

URLからKMLファイルにアクセスしてみてください。msidが一致します。

https://maps.google.com/maps/ms?msid=214791092532835797516.0004bc20df4e3c6ddf92a&msa=0&ll=52.812827,-2.079865&spn=0.003761,0.011689

KMLファイルへのリンクは次のようになります:https ://maps.google.com/maps/ms?ie = UTF8&authuser = 0&msa = 0&output = kml&msid = 214791092532835797516.0004bc20df4e3c6ddf92a

場所を取得するには、KMLを解析する必要があります

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Document>
  <name>Untitled</name>
  <description><![CDATA[]]></description>
  <Style id="style3">
    <IconStyle>
      <Icon>
        <href>http://maps.gstatic.com/mapfiles/ms2/micons/blue-dot.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="style2">
    <IconStyle>
      <Icon>
        <href>http://maps.gstatic.com/mapfiles/ms2/micons/blue-dot.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Style id="style1">
    <IconStyle>
      <Icon>
        <href>http://maps.gstatic.com/mapfiles/ms2/micons/blue-dot.png</href>
      </Icon>
    </IconStyle>
  </Style>
  <Placemark>
    <name>The Octagon</name>
    <description><![CDATA[<div dir="ltr">This is the description for the octagon</div>]]></description>
    <styleUrl>#style3</styleUrl>
    <Point>
      <coordinates>-2.081995,52.812881,0.000000</coordinates>
    </Point>
  </Placemark>
  <Placemark>
    <name>Sports centre</name>
    <description><![CDATA[<div dir="ltr">This is the description for the sports centre</div>]]></description>
    <styleUrl>#style2</styleUrl>
    <Point>
      <coordinates>-2.080439,52.812202,0.000000</coordinates>
    </Point>
  </Placemark>
  <Placemark>
    <name>Blackheath lane</name>
    <description><![CDATA[]]></description>
    <styleUrl>#style1</styleUrl>
    <Point>
      <coordinates>-2.072489,52.813522,0.000000</coordinates>
    </Point>
  </Placemark>
</Document>
</kml>

これでURLから場所を取得できると思いますが、Androidマップを簡単にカスタマイズする方法がわかりません。

アップデート:

KMLファイルの解析、stackoverflowリンク: kmlファイルを使用して地図上にパスを描画する方法は?

于 2012-07-11T07:58:47.260 に答える