Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Google Maps Petrol station mashup for Ireland. - Memory leaks, any ideas?

Options
  • 01-12-2005 3:23pm
    #1
    Registered Users Posts: 1,366 ✭✭✭


    Howdy

    I've put together a Google maps site that shows petrol stations and prices for the whole country. The site is basically Javascript with a php backend that makes calls to a MySQL database.

    www.pumps.ie

    I'm still adding stations to it but its a pretty handy little app.

    The questiong is does anyone know a good way of avoiding memory leaks while doing AJAX? I'm having problems with browsers memory growing and growing and growing!]

    Cheers!

    J


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    No, but that's a really cool idea for a site.


  • Registered Users Posts: 1,366 ✭✭✭whizzbang


    Evil Phil wrote:
    No, but that's a really cool idea for a site.

    cheers! Its my first go at AJAX and I'm quite happy with it! Please feel free to use the site and update any prices you may know!


  • Moderators, Music Moderators Posts: 1,481 Mod ✭✭✭✭satchmo


    Can't help you with the memory leak, but like Evil Phil said that'd a really great idea... I drive down to Cork every other weekend so I'll see what I can do about noting some of the prices on the way down.


  • Registered Users Posts: 986 ✭✭✭Jambo


    whizzbang excellent idea + site i'll def try keep it updated whenever / whereever I refuel . any chance you could stick this in a few other forums like motors so as to get more people aware of this ?


  • Registered Users Posts: 1,366 ✭✭✭whizzbang


    whizzbang excellent idea + site i'll def try keep it updated whenever / whereever I refuel . any chance you could stick this in a few other forums like motors so as to get more people aware of this ?

    Its in Motors and commuting, I didn't want to Spam too many boards! those seemed the most relavent! Please feel free to spread the word with anyone else you know! :)

    J


  • Advertisement
  • Closed Accounts Posts: 70 ✭✭vito


    whizzbang wrote:
    Howdy

    I've put together a Google maps site that shows petrol stations and prices for the whole country. The site is basically Javascript with a php backend that makes calls to a MySQL database.

    www.pumps.ie

    I'm still adding stations to it but its a pretty handy little app.

    The questiong is does anyone know a good way of avoiding memory leaks while doing AJAX? I'm having problems with browsers memory growing and growing and growing!]

    Cheers!
    J

    Very nice mashup.

    Have you looked at prototype or scriptaculous?

    I see you're using google's native GXmlHttp request method. I haven't any experience using the google api but know a bit about prototype which is a really great library (the best I have used).

    I would suggest temporarily removing fuelmap.js so that you can test whether the leak is in your code or the numerous google js scripts (which I doubt if you haven't changed any google code). I think its a fair bet to say that the leak is being caused not by the XmlHttp calls but more likely by something in your javascript code.

    Out of curiosity when is getCounties() called? How are you calling this function? Just wondering if the counties array might be causing the leak.

    Nice site though - would have to assume that you could be able to monetise the site somehow. Great to see someone in Ireland developing this kind of app.

    BTW do you use any geocoding for the station locations? I was looking for an API that could geocode Irish addresses (for free of course - not gonna pay An Post) for a mashup similar to this. I have been using AJAX a lot in an application I am developing for a client and was hoping to integrate a google maps mashup similar to yours.

    Best rgds

    Vito


  • Registered Users Posts: 1,366 ✭✭✭whizzbang


    Cheers! I have not looked at any other script library's although I understand there are lots of good ones out there!

    I have managed to reduce the memory useage through a lot of reuse of icons and creating variables outside of loops and things like that. There is some leaks still but I don't think they will effect people browsing the site.

    getCounties is called when the main body of the page is loaded in the browser, this is just so that the counties array is filled by the time anyone clicks the map.

    I hope that someday the site might make money, but for now its just google ads to try and pay for the hosting etc! If we get regular updates from the public and start having a good proportion of stations listed then it might be possible to make money from it. The main issue if getting high quality data to try and make sure anyone who pays for it is getting acurate information.

    As for geocoding I'm afraid these are all done by hand either by me in the car with a GPS or by people familiar with an area clicking on the map to mark station locations.

    Cheers for the interest! let me know if you have any ideas for features we could add!

    J
    vito wrote:
    Very nice mashup.

    Have you looked at prototype or scriptaculous?

    I see you're using google's native GXmlHttp request method. I haven't any experience using the google api but know a bit about prototype which is a really great library (the best I have used).

    I would suggest temporarily removing fuelmap.js so that you can test whether the leak is in your code or the numerous google js scripts (which I doubt if you haven't changed any google code). I think its a fair bet to say that the leak is being caused not by the XmlHttp calls but more likely by something in your javascript code.

    Out of curiosity when is getCounties() called? How are you calling this function? Just wondering if the counties array might be causing the leak.

    Nice site though - would have to assume that you could be able to monetise the site somehow. Great to see someone in Ireland developing this kind of app.

    BTW do you use any geocoding for the station locations? I was looking for an API that could geocode Irish addresses (for free of course - not gonna pay An Post) for a mashup similar to this. I have been using AJAX a lot in an application I am developing for a client and was hoping to integrate a google maps mashup similar to yours.

    Best rgds

    Vito


  • Registered Users Posts: 1,366 ✭✭✭whizzbang


    After a bit of sniffing around I have found a free geocoding databse for Ireland! well it does the whole world actually!
    http://earth-info.nga.mil/gns/html/cntry_files.html

    It does not go right down to street name but it does have 24000 town and area name salong with co-ordinates for them!

    You could pop these into a database and use them as a start for your service?

    J
    vito wrote:
    Very nice mashup.

    Have you looked at prototype or scriptaculous?

    I see you're using google's native GXmlHttp request method. I haven't any experience using the google api but know a bit about prototype which is a really great library (the best I have used).

    I would suggest temporarily removing fuelmap.js so that you can test whether the leak is in your code or the numerous google js scripts (which I doubt if you haven't changed any google code). I think its a fair bet to say that the leak is being caused not by the XmlHttp calls but more likely by something in your javascript code.

    Out of curiosity when is getCounties() called? How are you calling this function? Just wondering if the counties array might be causing the leak.

    Nice site though - would have to assume that you could be able to monetise the site somehow. Great to see someone in Ireland developing this kind of app.

    BTW do you use any geocoding for the station locations? I was looking for an API that could geocode Irish addresses (for free of course - not gonna pay An Post) for a mashup similar to this. I have been using AJAX a lot in an application I am developing for a client and was hoping to integrate a google maps mashup similar to yours.

    Best rgds

    Vito


  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    Your idea is already running over at www.mapeire.com in a beta stage, its a really great idea though.

    The lads over there have also got parking spaces and drink prices which are cool too.


  • Registered Users Posts: 1,366 ✭✭✭whizzbang


    Draupnir wrote:
    Your idea is already running over at www.mapeire.com in a beta stage, its a really great idea though.

    The lads over there have also got parking spaces and drink prices which are cool too.

    yep, I've seen mapeire.com, the lads are doing sterling work over there! I've decided to just stick with the petrol prices for now to keep things simple!

    Cheers!

    J


  • Advertisement
  • Registered Users Posts: 3,548 ✭✭✭Draupnir


    No worries man, you're site is very nice, I like the layout and its very usable.

    Its a fantastic idea.


  • Registered Users Posts: 1,366 ✭✭✭whizzbang


    Cheers! please spread the word to anyone you know who is interested! the more users it has the better it will be!

    J
    Draupnir wrote:
    No worries man, you're site is very nice, I like the layout and its very usable.

    Its a fantastic idea.


  • Closed Accounts Posts: 70 ✭✭vito


    Taking a look now.

    Mind you I would really love to get a free API service somewhere to geocode on the fly from the backend.

    Pipe dreams for now me thinks but can always dream!

    Rgds

    Vito
    whizzbang wrote:
    After a bit of sniffing around I have found a free geocoding databse for Ireland! well it does the whole world actually!
    http://earth-info.nga.mil/gns/html/cntry_files.html

    It does not go right down to street name but it does have 24000 town and area name salong with co-ordinates for them!

    You could pop these into a database and use them as a start for your service?

    J


Advertisement