should encoded polylines be usable as-is with Google static maps?

879 views
Skip to first unread message

Dylan Kuhn

unread,
Mar 21, 2014, 6:02:56 PM3/21/14
to strav...@googlegroups.com
Since Google's encoding algorithm is used for polylines, I thought I might be able to transform a JSON response like

"map": {
    "id": "a32193479",
    "polyline": "kiteFpCBCD]",
    "summary_polyline": "{cteFjcaBkCx@gEz@R",
    "resource_state": 3
  }

into a Google static maps URL like this:


Obviously it doesn't quite work. Before I delve into figuring out why, should it?

-dylan-

Paul Mach

unread,
Mar 21, 2014, 6:14:48 PM3/21/14
to Dylan Kuhn, strav...@googlegroups.com
I guess the sample isn't a valid encoding. I shorted it so the docs would look good :)


works fine from another activity.

Dr. Paul Mach
STRAVA


--
You received this message because you are subscribed to the Google Groups "Strava API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strava-api+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

sascha...@googlemail.com

unread,
Mar 22, 2014, 3:08:50 AM3/22/14
to strav...@googlegroups.com, Dylan Kuhn
You should check the polyline. I also use the static maps url from google to get an image and it works great:

My code:

public async void LoadMap()
        {
            String url = String.Format("http://maps.googleapis.com/maps/api/staticmap?sensor=false&maptype={0}&size=150x150&path=weight:3|color:red|enc:{1}",
                "terrain",
                ActivityEntry.Activity.Map.SummaryPolyline);

            Image image = await ImageLoader.LoadImage(new Uri(url));
            pictureMap.Image = image;
        }


Brad Messenger

unread,
Mar 23, 2015, 12:47:19 PM3/23/15
to strav...@googlegroups.com, dylan...@gmail.com
I'm having a similar issue...   The g-maps api is returning a generic image.  This just started happening, was working fine before.  This is an example URL (using polyline from strava api):

http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=300x300&path=weight:3%7Ccolor:red%7Cenc:{ecxElqawNkNk@e@_D_FxDVyUtCiNXwn@qMyAcf@eh@qGiS{H_C{JiIUkb@cQm@}DwZ{RpD}AgNmZsBViQqA[ku@cE[v\q@ZgmAaNcPs[gE_Bp@wEoBqKgB|DRtDcHzK~B}[fAuDvGsDsD{G^iNtAoBcFuA@qI|B{@jNlFsGQhDtF{BhItAhBfGe@@yAgDp@^gC`Uw@vAwH~EsC{GsAeGmQvJzLtd@`DzLvNfBzEnNrDnGY|B~JdHr@~E{ArBdPlOvGhP{E|@zAq@|JbArDfElChGBrD`StFnMzDzZ|BxC|C~U`Nn@T~RbKbIlIrC~C`OdJfKsBfCnClDs@zBpCg@rVjVc@|AjAhAhFj@e@|N`EnCrBrP{CvP_@fVjF{Dp@~CjND

Paul Mach

unread,
Mar 23, 2015, 4:02:37 PM3/23/15
to Brad Messenger, strava-api, Dylan Kuhn
I copy pasted that link into my browser window got a nice map, see attached. Maybe you've been ratelimited?



Dr. Paul Mach
STRAVA
staticmap.png
Reply all
Reply to author
Forward
0 new messages