안드로이드 개발 질문/답변
(글 수 45,052)
예를 들어,
<?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>wacon.kmz</name>
<Style id="sn_ylw-pushpin_copy200">
<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>
<LineStyle>
<color>ff0000ff</color>
<width>2</width>
</LineStyle>
</Style>
<Folder>
<name>채널2</name>
<open>1</open>
<Placemark>
<name>채널2/점검구4</name>
<description>채널2 제4점검구</description>
<LookAt>
<longitude>127.0699053026643</longitude>
<latitude>37.05878142498015</latitude>
<altitude>0</altitude>
<range>86.08954465443274</range>
<tilt>0</tilt>
<heading>-0.009226241375606351</heading>
<altitudeMode>relativeToGround</altitudeMode>
</LookAt>
<styleUrl>#msn_icon61_copy290</styleUrl>
<Point>
<coordinates>127.070169014511,37.05874881988424,0</coordinates>
</Point>
</Placemark>
</Folder>
이런 라인이 있다면, 필요한 부분만 추출해서 이클립스의 자바 파일에 넣어 실제 구글어스로 실행시킬 때와 거의 유사한 효과를 얻을 수 있을까요??
2010.02.06 19:56:16
자문자답이네요.
Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri uri1 = Uri.parse("geo:0,0?q=http://............................");
mapIntent.setData(uri1);
startActivity(Intent.createChooser(mapIntent, "Sample"));
이 소스를 onCreate로 넣어주면, 알아서 파일을 찾아 로딩까지 해주는군요.
아... 이 소스 여기저기서 많이 봤었는데 아닌거 같은 느낌이 들었었지만,
결국에 일단 해보는게 최선이군요.
Intent mapIntent = new Intent(Intent.ACTION_VIEW);
Uri uri1 = Uri.parse("geo:0,0?q=http://............................");
mapIntent.setData(uri1);
startActivity(Intent.createChooser(mapIntent, "Sample"));
이 소스를 onCreate로 넣어주면, 알아서 파일을 찾아 로딩까지 해주는군요.
아... 이 소스 여기저기서 많이 봤었는데 아닌거 같은 느낌이 들었었지만,
결국에 일단 해보는게 최선이군요.