Any google maps API...
 

  You don't need to be an 'investor' to invest in Singletrack: 6 days left: 95% of target - Find out more

[Closed] Any google maps API experts here?

7 Posts
4 Users
0 Reactions
63 Views
Posts: 2
Free Member
Topic starter
 

I need to see the data that is being fed to the API from this site.
http://www.marinetraffic.com/ais/default.aspx?zoom=9&oldmmsi=13633757&olddate=10/11/2011%208:38:00%20AM

I think I should be able to see the data in XML somewhere but I am lost.


 
Posted : 11/10/2011 12:27 pm
Posts: 0
Free Member
 

Have a look in here - might give you some answers?

http://www.marinetraffic.com/ais/aistraffic_v3.js


 
Posted : 11/10/2011 3:17 pm
Posts: 80
Free Member
 

There's a fair few ajax calls going on in the abckend there.

Looks like its pullign XML for various different things, ie: ships, ports, tracks etc and the URL and params are different depending on what you're after.

start searching through the JS that xiphon linked to for 'downloadUrl' (which is a function call that's actually retrieving the data) to find the URLs for the ajax calls that are firing, and what parameters/variables are being set.

If you don't already have it install Firebug or similar for your browser of choice so you can start meddling with the calls in real time.

The Google maps API is actually quite easy to get to grips with, its working out how to feed it the right info that takes time.
Matt


 
Posted : 11/10/2011 3:59 pm
Posts: 2
Free Member
Topic starter
 

Excellent thanks guys I think you have given me the information to answer the question. Your legends!


 
Posted : 11/10/2011 4:02 pm
Posts: 2
Free Member
Topic starter
 

Its the tracks I need.


 
Posted : 11/10/2011 4:03 pm
Posts: 2
Free Member
Topic starter
 

Got it thanks. The GetTracking function just gave me everything I needed 🙂


 
Posted : 11/10/2011 4:10 pm
Posts: 0
Free Member
 

Assuming you've got google chrome, you can watch all the ajax calls being made.
Open the webpage in chrome

Use CTRL+SHIFT+I (or navigate to Current Page Control > Developer > Developer Tools. In the newer versions of Chrome, click the Wrench icon > Tools > Developer Tools.) to enable the Developer Tools.

From within the developer tools click on the Network button. If it isn't already, enable it for the session or always.

Click the "XHR" sub-button.

Initiate an AJAX call.

You will see items begin to show up in the left column under "Resources".

Click the resource and there are 2 tabs showing the headers and return content.

So when I press refresh I see calls to -
[url] http://www.marinetraffic.com/ais/getshipcountxml.aspx [/url]

[url] http://www.marinetraffic.com/ais/getjson.aspx?sw_x=-3&sw_y=50&ne_x=0&ne_y=52&zoom=9&fleet=&station=0 [/url]

[url] http://www.marinetraffic.com/ais/gettrackxml.aspx?mmsi=13633757&date= [/url]

[url] http://www.marinetraffic.com/ais/getareasxml.aspx [/url]


 
Posted : 11/10/2011 4:10 pm
Posts: 0
Free Member
 

Glad you're sorted 🙂


 
Posted : 11/10/2011 4:17 pm

6 DAYS LEFT
We are currently at 95% of our target!