apneadiving/Google-Maps-for-Rails — Issue #149: Can't manage to display array_coded polylines
Author: clmntlxndr
Created: 2012-02-08 00:27:28+00:00
State: open

Hi !

I'm trying to do something like :

```erb
<%= gmaps({
"polylines" => {:data => '[ [
{"coded_array":"{pdkHnhjAKbC"},{"coded_array":"gqdkHrljAcBOqAQ_@GqEu@sBW"},{"coded_array":"cbekHzhjACf@OfD?XAJAT"}
],
[
{"lng": -120.214897, "lat": 30.772323, "strokeColor": "#000", "strokeWeight" : 2 },
{"lng": -10.821856, "lat": 50.291982}
] ]' }

})
%>
```

I only get the 2nd polyline made of coord but not the first returned by Google Directions.
If I only use the coded_array I don't get anything.

I also tried

```ruby
:data => @directions[0]["polylines"] # where @direction is retrieved with Gmaps4rails.destination
```
and

```ruby
:data => "[#{@directions[0]["polylines"]}]" # ôO
```

I don't got anything neiter :(

In the JS console of my browser, when I do this :

```javascript
window.Gmaps.map.create_polylines({coded_array: "{pdkHnhjAKbC"})
```

I get :

```javascript
=> [undefined, undefined]
```

So I wonder if something may be broken ?

If it's about something I didn't understand, an "how to" display a Google direction (caught from model's Gmaps4rails.destination) on a map woud be nice.

Great work BTW :) :)