shtern / TimeUpp

Initial version of an incredibly smart application
3 stars 0 forks source link

Открыть GMAP с захватом адреса в приложение #2

Open MrMihap opened 10 years ago

MrMihap commented 10 years ago

https://developers.google.com/maps/documentation/android/index#classes здесь обширное описание классов для взаимодействия

MrMihap commented 10 years ago

Show a location on a map

To open a map, use the ACTION_VIEW action and specify the location information in the intent data with one of the schemes defined below.

Action ACTION_VIEW Data URI Scheme geo:latitude,longitude Show the map at the given longitude and latitude. Example: "geo:47.6,-122.3"

geo:latitude,longitude?z=zoom Show the map at the given longitude and latitude at a certain zoom level. A zoom level of 1 shows the whole Earth, centered at the given lat,lng. The highest (closest) zoom level is 23. Example: "geo:47.6,-122.3?z=11"

geo:0,0?q=lat,lng(label) Show the map at the given longitude and latitude with a string label. Example: "geo:0,0?q=34.99,-106.61(Treasure)"

geo:0,0?q=my+street+address Show the location for "my street address" (may be a specific address or location query). Example: "geo:0,0?q=1600+Amphitheatre+Parkway%2C+CA"

Note: All strings passed in the geo URI must be encoded. For example, the string 1st & Pike, Seattle should become 1st%20%26%20Pike%2C%20Seattle. Spaces in the string can be encoded with %20 or replaced with the plus sign (+).

MIME Type None Example intent:

public void showMap(Uri geoLocation) { Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(geoLocation); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); } } Example intent filter:

<activity ...>

MrMihap commented 10 years ago

еще годная статья http://code.tutsplus.com/tutorials/android-sdk-working-with-google-maps-map-setup--mobile-15896