June 25, 2009, 3:10 pm by Alex
|
Comment | 370 views
After a little time away from programming and active web development, I thought I’d get back into things by giving myself a little project to create a Google maps and Upcoming mashup.
At the moment it’s fairly basic as I’ve only spent a few hours working on it, but seems to be working well. I’ve deliberately tried to keep the number of options and fields down to a minimum (I know there are far more options and functions I could add).
Enter some search text in the ‘What?’ field, then a location in the ‘Where?’, finally select ‘When?’. All the events matching your search (within a 50mile radius of the location) will be shown on the map. Click on the marker to get more info about the event.
Neither the ‘what?’ or ‘where?’ field are required, either or both may be left blank. If the ‘what?’ is omitted then all events in the area are shown and if the ‘where?’ is omitted then the centre of the current view of the map is used.
All the events are from Upcoming and you can use their interface to add your own event, to then appear on the map.
For the technically minded, the site uses the Google Maps API (including for geocoding the location) and the Upcoming API.
If you know of any other feeds I could use for adding events to the map, then please let me know so I can try adding them.
I’d also be grateful for any feedback, problems or suggestions – just leave a comment below.
May 7, 2008, 2:53 pm by Alex
|
1 Comment | 1,349 views
This morning I gave a little presentation about Google Maps at the IET Technology Coffee Morning. It’s a very quick look at some different things you can do with Google Maps…
(update: unfortunately the embedded links don’t seem to have come though on the slideshare version :-/ so you can download the original ppt)
July 3, 2007, 2:18 pm by Alex
|
Comment | 443 views
Just found the first thing that I’m a little disappointed with regarding Google Maps… I was trying to get my map to load it’s points from a KML file – for which there is very simple code to achieve (couple of lines) – and all worked fine when I was pointing to mykml.xml. But as soon as I change this to be mykml.php (because the kml is dynamically generated as the points are regularly changing – and even at the same point in time may be different for different users), the points fail to appear on my map. As it works for .xml and .txt extensions I can only assume that Google have blocked kml files that are obviously (given the file extension) dynamically generated.
I’m unsure as to why they would have placed this restriction (perhaps for performance reasons?) – so any info on this welcome – or if I’m doing something wrong?
I think I may have found a work around (this comment in particular), but I’ve not tried it out yet to see if it works, but will give it a go now…
Update (17/08/07): For info that particular work around didn’t work for me – I found lots of other links to work arounds, but unfortunately they all rely on changing the web server so KML files are processed in the same way as ‘normal’ PHP files. Unfortunately, this isn’t really an option for me, as it’s part of a new Moodle block which people would download and run on their own server and I’d like people to be able to the install and run it without having to fiddle with their web server. Guess it’s back to JSON requests to grab the markers…
February 8, 2007, 12:44 pm by Alex
|
Comment | 406 views
Have updated to use double rather than float and that appears to give me the precision I now need and it’s done the trick – found I had one or two other little bugs too that needed fixed so has taken me longer to get this sorted than I would’ve liked.
Also, now that it’s done there appears to be some slight anomalies when the clustering is viewed on Google maps, though this is actually just to do with where the grid boundaries are and the concentration of points around intersections of the grid lines. Take the image below as an example:

The lines are the grid squares, the black dots represent the actual locations and the red dots where the points have been clustered for a given square. If the above was represented on Google maps, then there would be 4 markers relatively close together (possibly overlapping), whereas you would probably expect the points to be clustered to a single point, some where in the middle of the image.
Anyway, this only seems to be cropping up on certain zoom levels (to do with where the divisions of the squares occur) and in certain areas and I don’t think there’s much I can do about it unless I implemented a ‘proper’ clustering algorithm – as opposed to an approximation to one.
January 4, 2007, 3:34 pm by Alex
|
Comment | 469 views
Have progressed well over the last few days (and the few days before Christmas) getting the Google Maps fixed up. I now have a clustering algorithm implemented (admittedly not a very sophisticated one, but it does the job) so we don’t end up with loads of overlapping markers when the user has zoomed out (see below):
Without clustering:

With clustering:

This appears to work quite well with around 100 or so different markers on a map (not yet tested for much higher numbers of markers). The ‘cluster’ that each marker belongs to for a given zoom level is cached in a database, this is to save having to recluster the markers on the fly – which will get really resource intensive for large numbers of markers. We should also be able to use more efficient clustering algorithms without having to change any of the map interface code.
Few more things that I’m working on now…
- Using different marker icons depending on the number of users in a cluster (larger icon = more users)
- Moving the maps so they become part of the MSG client rather than part of Moodle (as they currently are) – this shouldn’t be a massive job, but will involve moving services currently provided by MSG block in Moodle to be from MSG & Wildfire servers
- Looking at how to implement custom maps within Google Maps API
That’s probably enough to be getting on with for now
December 20, 2006, 4:50 pm by Alex
|
2 Comments | 1,404 views
Have just done my first version of overlaying geolocation info for MSG users onto Google Maps. At the moment it’s pretty rough and ready (only on my dev server), but seems to do the basics, eg changes the ‘pin’ when a users state changes. Quick screenshot here with users having different presence states:

Another problem for me to work on is how to ‘cluster’ users, as things stand with my map, users will only be clustered if they have exactly the same latitude and longitude – which fairly quickly starts to break down – on the image above there are several pins around Milton Keynes and it’s not really obvious exactly how many users are there – or whether there are more pins hidden behind the pins you can already see.
So I’m going to look to see how we can do the clustering more sensibly (perhaps at different resolutions of Google maps), this was solved quite well in BuddySpace, so I’m going to have a look at the algorithm used there (see the tech report on it) and see if I could apply the same algorithm, or if other algorithms have been developed in the last few years.
October 13, 2006, 2:16 pm by Alex
|
2 Comments | 511 views
Spent the morning having a play around with Google maps as we’re looking to embed maps into the MSG – I’ve got a simple page set up (here) to demo listing contacts – you can then click on the contact to show their location on the map.
However, what we’d really like would be to have would be all contacts shown on the same map (my current example just show one contact at a time). I had a go at doing this with the Google maps API, but all UK addresses seemed to draw a blank – then I found out about the issue of having the lat/long coordinates for UK addresses (some copyright thing! – see all the messages in this forum about it). So it seems (from my current understanding after my brief delve into this stuff this morning) that I’d need to get hold of a geocode database to use with Google maps. Apparently the OU might already have a geocode db I can use – so I’ll need to see if I can track this down and get permission to make use of it.
There are plenty of other options for us I guess including…
- use another mapping service which does provide UK geocodes
- use IP lookup – I know this wouldn’t be too accurate for lots of people – but could make a best guess & give users the option to update if they want
- integrate in a postcode/geocode db – there are apparently free ones, that only have the first part of the postcode – but that’s actually all we want for this application!
Anyway, I shall keep going and see if I can get any further