Jump to content

New BMFA club list


Recommended Posts

Advert


OK, take 2...

Problem found.  Two things,  firstly the XML data is malformed, secondly the javascript coding "could be better".

So, it seems some clubs don't have any location details. In the XML rather than showing the latitude and longitude elements with no data they miss the elements out altogether.  Not a problem neccesarily,  but combined with bad code...

For a club search the code reads the first name, latitude and longitude elements from the XML and checks to see if the name matches the one you're looking for.  If not it reads the next name, latitude and longitude elements and continues until it gets a match.  So it now has the n'th name, the n'th latitude and the n'th longitude.  In an ideal world these would all 'belong' to the same club.  But since some clubs don't have latitude and longitude the n'th latitude and longitude actually belong to a club further down the list than the n'th clubname!  OOPS!

So it all starts OK, and the first club in the XML data (Limvady) displays in the correct location.  The first club with no location is Surrey Freedom Flyers and they "inherit" the location of the next club in the XML data - Border Model Aircraft Club.  The further down the XML data you get, the further out of step the data gets.  Now XML parsing is not one of my specialities, but surely it should be possible to loop through each club's data and retrieve the name, latitude and longitude for the club, rather than hoping that the n'th occurence of each data element belong to the same club?

So either sort out the code, or get the XML data corrected, or both.  Then - and only then - will the map work!

Now,  who I send my invoice to at the BMFA for consultancy?  wink 2

Edited By John Privett on 06/12/2012 02:19:29

Link to comment
Share on other sites

Reading my posts from last night just shows I should stay away from forums after a bad day at work!

Anyway it looks like somebody has been very busy making changes and having a quick look the points seem to be correct

The Latitude and Longitude have been reformatted to remove the 'e+001' and 'e+000' off the end and the values corrected.

Just slightly better storage of the data but the problem with JavaScript is that everything is visible to the client browser including the hidden directory name! I guess it would confuse 90% of web surfers but it is still not very secure.

Edited By WolstonFlyer on 06/12/2012 15:07:13

Link to comment
Share on other sites

Yep - the locationless clubs have now been removed from the data - which makes sense! - and the format of long. and lat. made simpler - though to be fair the previous format worked as far as showing something on the map was concerned! The clubs were all in the "right" places, but just with the wrong names!

I'm not sure there's a lot of point in the "encryption" of the hidden directory - anybody who knows enough to see that there's something there that's "encrypted" probably knows enough to be able to see what the unencrypted value is. Still, it's probably better than nothing!

Link to comment
Share on other sites

Posted by Biggles' Elder Brother - Moderator on 06/12/2012 14:02:27:

Hope you got paid John! Object lesson that - never let the client see the solution until you see the colour of their money! wink 2

LOL, BEB! I'm sure they knew the solution without having to refer to my early-morning ramblings! I reckon I'll get paid exactly what you get for your sterling work on the forum. What's the going rate? Is it still 1 sticky bun per annum? cake

Joking aside, good to see a fix applied quickly on the BMFA website, hope it sets a trend for the future!

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...