Class: Strava::Models::Map

Inherits:
Response show all
Defined in:
lib/strava/models/map.rb

Overview

Represents a map with polyline data for an activity, route, or segment.

Maps contain encoded polyline data that represents the geographic path. The polyline format uses Google's encoded polyline algorithm which can be decoded using libraries like the 'polylines' gem.

Examples:

Decode and use polyline data

require 'polylines'

activity = client.activity(1234567890)
map = activity.map

# Decode the summary polyline
decoded = Polylines::Decoder.decode_polyline(map.summary_polyline)
start_point = decoded.first  # [latitude, longitude]
end_point = decoded.last

# Use with Google Maps Static API
url = "https://maps.googleapis.com/maps/api/staticmap?" \
      "path=enc:#{CGI.escape(map.summary_polyline)}&size=800x800"

See Also:

Instance Method Summary collapse

Instance Method Details

#idString

Returns Map identifier.

Returns:

  • (String)

    Map identifier



31
# File 'lib/strava/models/map.rb', line 31

property 'id'

#polylineString

Returns Google polyline encoding of the route (higher resolution).

Returns:

  • (String)

    Google polyline encoding of the route (higher resolution)



40
# File 'lib/strava/models/map.rb', line 40

property 'polyline'

#resource_stateInteger

Returns Resource state indicator.

Returns:

  • (Integer)

    Resource state indicator



37
# File 'lib/strava/models/map.rb', line 37

property 'resource_state'

#summary_polylineString

Returns Google polyline encoding of the route (lower resolution).

Returns:

  • (String)

    Google polyline encoding of the route (lower resolution)



34
# File 'lib/strava/models/map.rb', line 34

property 'summary_polyline'