# Map not showing Javascript

**URL:** <https://discussions.flightaware.com/t/map-not-showing-javascript/15000>\
**Category:** AeroAPI\
**Created:** [March 18, 2014, 9:36pm UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000 "2014-03-18T21:36:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![magichatguy](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@magichatguy](https://discussions.flightaware.com/u/magichatguy)\
**Post date:** [March 18, 2014, 9:36pm UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000/1 "2014-03-18T21:36:46Z")

</div>

Hey I am using FlightInfoEx and DecodeFlightRoute in with Javascript in Ruby and when I type in the indent info for a flight I get the origin and destination but the map is not showing up… I get this error Uncaught TypeError: Cannot read property ‘data’ of undefined. It has to do with this part of code

var points = result.DecodeFlightRouteResult.data;  
table.addRows(points.length);  
for (rowid = 0; rowid \< points.length; rowid++) {  
table.setCell(rowid, 0, points[rowid].latitude);  
table.setCell(rowid, 1, points[rowid].longitude);  
table.setCell(rowid, 2, points[rowid].name + ’ (’ + points[rowid].type + ‘)’ );  
}

I copied the jasvascript example and replaced the api and username with my info. Any ideas as to why I am not seeing the map?

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [March 18, 2014, 10:34pm UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000/2 "2014-03-18T22:34:22Z")

</div>

The example doesn’t have exhaustive error handling, so it fails if an empty response is returned by the server. Not all flight routes can be successfully decoded, particularly if it is too far in the future or the flight route involves navaids outside of the continental United States. Although actual arbitrary positions can be returned by FlightXML’s GetHistoricalTrack, the route decoding functions can only handle state-side routes.

---

<div class="post-metadata">

**Author:** ![magichatguy](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@magichatguy](https://discussions.flightaware.com/u/magichatguy)\
**Post date:** [March 18, 2014, 10:42pm UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000/3 "2014-03-18T22:42:08Z")

</div>

Thanks for the fast response… All of my searches have been state side. I am getting a blank map but I am getting the flight origin and destination… Do I have to have to save to the database to show me the points on the map?

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [March 19, 2014, 12:40am UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000/4 "2014-03-19T00:40:57Z")

</div>

There is no database in that sample. “addRow” just refers to the in-memory list that Google Maps API uses.

---

<div class="post-metadata">

**Author:** ![rahonny](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/rahonny/32/12318_2.png) [@rahonny](https://discussions.flightaware.com/u/rahonny)\
**Post date:** [June 2, 2014, 8:47am UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000/5 "2014-06-02T08:47:57Z")

</div>

> [@bovineone](#):
>
> There is no database in that sample. “addRow” just refers to the in-memory list that Google Maps API uses.

I am having same problem but I managed to get the values this morning.

But now I’m encountering this problem.

What is the problem…

TQ

---

<div class="post-metadata">

**Author:** ![bovineone](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/bovineone/32/117631_2.png) [@bovineone](https://discussions.flightaware.com/u/bovineone)\
**Post date:** [June 2, 2014, 3:09pm UTC](https://discussions.flightaware.com/t/map-not-showing-javascript/15000/6 "2014-06-02T15:09:36Z")

</div>

The original post was about failing to decode routes. As I mentioned in my original reply, “Not all flight routes can be successfully decoded, particularly if it is too far in the future or the flight route involves navaids outside of the continental United States”
