Hi there, I will understand if this drops off the bottom quicker than a quick thing, but I thought somebody might find it interesting/helpful if they are into this kind of thing.
I am a programmer, make of that what you will, so I make websites and that at work, some client wanted some kind of map interface so I jumped aboard the Google maps API bandwagon and got carried away, there's loads of good stuff you can get invoved with, and make your own map application on your website, the code is all yours.
What I wanted it to do:
Why bother? Well people like to have self contained websites, and without any google imagery going on it is totally integrated.
It also lets you manage your markers, add your own information to those markers and also decide on how the rest of the page will look, and what information it will contain.
The google maps API, unfortunately cannot give you accurate geolocation based on a UK postcode or address. This may seem counter productive, but Royal Mail will not give this information away for free, and they are the people who own it.
Google says that their API geolocation is accurate to 10 miles, which is pathetic.
I found that you can get round this, using googles search API, which must annoy Royal Mail. You essentially trick google into searching it's vast resources for a postcode, bypassing the geolocation object all together. This returns you a latitude and longitude which you can then use with google maps to plot a position.
So with that information sorted, I created some ASP session variables, and set up the map page to read some XML, create a marker for each marker node it finds in the XML, replace key text that it finds in an html template with data from the XML, sort the array of markers by distance then display the whole lot, resulting in this page:
Here I have clicked on a heading in the sidebar, which centres the map on the marker in question and displays some html.
And here I have changed the distance to show me everything within 100 miles, rather than the default 25miles, this re-creates the array ignoring any markers with a distance from the centre point over that I have specifed.
If anyone is interested in the code ( you never know ;D) then I would be happy to put it on here.
God I am boring, of you got this far then well done.
I am a programmer, make of that what you will, so I make websites and that at work, some client wanted some kind of map interface so I jumped aboard the Google maps API bandwagon and got carried away, there's loads of good stuff you can get invoved with, and make your own map application on your website, the code is all yours.
What I wanted it to do:
- Plot markers for each person/shop/whatever based on XML
- Plot your search marker on the map in a different colour
- Show markers based on miles from central point, e.g. show all markers within 50 miles
- Zoom the map accordingly based on that distance
- Work out the distances between your central point and each marker
- Give you the marker information in order of distance from central point in a sidebar
- Link the sidebar click to the map, and center the map on your choice
- Allow dynamic xml, so searching on category could be used e.g. show me all shops who sell shoes within 100 miles.
- Send the two points of reference (central point and marker) off to googlemaps and make it show directions between the two places, starting or ending at either point
Why bother? Well people like to have self contained websites, and without any google imagery going on it is totally integrated.
It also lets you manage your markers, add your own information to those markers and also decide on how the rest of the page will look, and what information it will contain.
The google maps API, unfortunately cannot give you accurate geolocation based on a UK postcode or address. This may seem counter productive, but Royal Mail will not give this information away for free, and they are the people who own it.
Google says that their API geolocation is accurate to 10 miles, which is pathetic.
I found that you can get round this, using googles search API, which must annoy Royal Mail. You essentially trick google into searching it's vast resources for a postcode, bypassing the geolocation object all together. This returns you a latitude and longitude which you can then use with google maps to plot a position.
So with that information sorted, I created some ASP session variables, and set up the map page to read some XML, create a marker for each marker node it finds in the XML, replace key text that it finds in an html template with data from the XML, sort the array of markers by distance then display the whole lot, resulting in this page:
Here I have clicked on a heading in the sidebar, which centres the map on the marker in question and displays some html.
And here I have changed the distance to show me everything within 100 miles, rather than the default 25miles, this re-creates the array ignoring any markers with a distance from the centre point over that I have specifed.
If anyone is interested in the code ( you never know ;D) then I would be happy to put it on here.
God I am boring, of you got this far then well done.