GeoDeeplinkParser

object GeoDeeplinkParser

Converts external geo intents into GeoDeeplink objects.

Public documentation for the geo deeplink can be found here https://developers.google.com/maps/documentation/urls/android-intents

Variations supported.

  • Coordinates without a place query geo:37.757527,-122.392937

  • Coordinates with a place query geo:37.788151,-122.407543?q=3107 Washington Street, San Francisco, California 94115, United States

  • Place query without coordinates geo:0,0?q=3107 Washington Street, San Francisco, California 94115, United States

  • Encoded deep-links geo:0,0?q=%E5%93%81%E5%B7%9D%E5%8C%BA%E5%A4%A7%E4%BA%95%206-16-16%20%E3%83%A1%E3%82%BE%E3%83%B3%E9%B9%BF%E5%B3%B6%E3%81%AE%E7%A2%A7201%4035.595404%2C139.731737

  • AT(@) symbol specifying coordinates geo:0,0?q=Coffee Shop@37.757527,-122.392937

  • Parenthesis specifying the place query geo:0,0?q=54.356152,18.642736(ul. 3 maja 12, 80-802 Gdansk, Poland)

Functions

Link copied to clipboard
fun parse(geoDeeplink: String?): GeoDeeplink?

Convert a string into a GeoDeeplink object. Returns a GeoDeeplink when the string starts with "geo:"