Skip to content

Instantly share code, notes, and snippets.

@tarakanbg
Created January 23, 2013 16:55
Show Gist options
  • Save tarakanbg/4609815 to your computer and use it in GitHub Desktop.
Save tarakanbg/4609815 to your computer and use it in GitHub Desktop.
# An example of normal route:
route = "EGLL-LOWI"
route.gcmap # => Returns an image map URL for the route EGLL-LOWI
# An exampmle of layover route:
another_route = "LFST-LSZH-LBSF"
another_route.gcmap # => Returns an image map URL for the layover route LFST-LSZH-LBSF
# The method can be applied directly to a string:
"EGLL-LOWI".gcmap # => Returns an image map URL for the route EGLL-LOWI
# It's not case sensitive:
"egll-lowi".gcmap # => Returns an image map URL for the route EGLL-LOWI
# Passing width only (default is 720px):
route = "egll-lowi"
route.gcmap(:width => "600") # => Returns an image map URL with width set to 600px
# Passing height only (default is 360px):
route = "egll-lowi"
route.gcmap(:height => 400) # => Returns an image map URL with height set to 400px
# Passing width and height:
"egll-lowi".gcmap(:width => "800", :height => "400") # => Returns an image map URL with width 800px and height 400px
# Enabling terrain overlay:
route = "egll-lowi"
route.gcmap(:terrain => true) # => Returns an image map URL with terrain overlay enabled
# Setting width, height and enabling terrain overlay:
"egll-lowi".gcmap(:width => 800, :height => 400, :terrain => true) # => Returns an image map URL with set width, height and terrain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment