kessa
08-24-2007, 06:44 AM
Hi Guys,
I thought I'd have a go at creating a Google maps mashup (as it's something which I'm quite keen to learn how to do), but I seem to have fallen at one of the first hurdles and after 3 days of solid searching / trying different things I don't seem to have got any further, so thought it was time to ask for help :o
Aim of the Mashup:
Ultimately what I would like to be able to do is:
Back end:
a) allow registered users to plot their location on the map (I'll set up the database using .asp and Access)
b) allow users to update their location on the map (I'd quite like to be able to use the Draggable Markers (http://www.google.com/apis/maps/documentation/index.html#Draggable_Markers)option for this)
c) ensure that users will only be able to display one location for themselves.
d) allow users to specify an account type (required) - this will display a different colour icon on the front end - originally I'd planned on getting users to specifiy their account type by just selecting it from a drop down in the admin area.... unless there's a way to let them select the icon appropriate to their account, and then drag it on to the map?
Front end:
a) display all users on the map
b) use a technique similiar to the one shown at http://labs.google.com/ridefinder to display a different coloured icon depending on the users account type (see note above)
c) use the Weather Map (http://www.google.com/apis/maps/documentation/index.html#Marker_Manager_Weather) example / technique of displaying only a certain number of results depending on the zoom level.
d) when a marker is hovered over, display a window which shows some basic info (grabbed from the DB) and an image - I might opt for the tabbed window solution for this depending on the amount of content
Progress so far:
I'm the first to admit that I've progressed very little in 3 days :o :( I guess I should emphasise at this point that whilst I'm more than happy coding in XHTML and CSS, my .asp skills are "developing" and my JavaScript skills are pretty much nill (I can read it, and get the gist of what's going on, but I can't code in it yet)
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(54.162433999999998, -3.6474609999999998), 4);
//listen for clicks (** This bit works - do not remove yet **)
GEvent.addListener(map, "click", function(overlay, point) {
if (overlay) {
map.removeOverlay(overlay);
} else {
map.addOverlay(new GMarker(point));
}
});
}
}
//]]>
</script>
So as you can see - so far all I've managed to do is allow users to add / remove an unlimited number of markers... which isn't very helpful at all :(
I've checked out the tutorials, and have posted on the Google Discussion Board (only had 1 reply there so far), and checked out a few other sites, but just keep coming up against the same problems - which is that most sites assume that you have a good knowledge of JavaScript and API's - there doesn't seem to be any such thing as a real "beginner's guide"
Any ideas?
If someone could just let me know how to go about:
a) finding out the location of a marker when it's been placed
b) how to save this using .asp (i.e. to I somehow just assign this to a variable?)
c) how I can limit the marker to just one per user
... that should be enough to get me going again.
I'm not after someone to create all of the code for me (although if someone already has the code and want's to share it I certainly wouldn't mind ;) ) but I'm more than happy to learn if I can get a pointer in the right direction.
Thanks
Kessa
I thought I'd have a go at creating a Google maps mashup (as it's something which I'm quite keen to learn how to do), but I seem to have fallen at one of the first hurdles and after 3 days of solid searching / trying different things I don't seem to have got any further, so thought it was time to ask for help :o
Aim of the Mashup:
Ultimately what I would like to be able to do is:
Back end:
a) allow registered users to plot their location on the map (I'll set up the database using .asp and Access)
b) allow users to update their location on the map (I'd quite like to be able to use the Draggable Markers (http://www.google.com/apis/maps/documentation/index.html#Draggable_Markers)option for this)
c) ensure that users will only be able to display one location for themselves.
d) allow users to specify an account type (required) - this will display a different colour icon on the front end - originally I'd planned on getting users to specifiy their account type by just selecting it from a drop down in the admin area.... unless there's a way to let them select the icon appropriate to their account, and then drag it on to the map?
Front end:
a) display all users on the map
b) use a technique similiar to the one shown at http://labs.google.com/ridefinder to display a different coloured icon depending on the users account type (see note above)
c) use the Weather Map (http://www.google.com/apis/maps/documentation/index.html#Marker_Manager_Weather) example / technique of displaying only a certain number of results depending on the zoom level.
d) when a marker is hovered over, display a window which shows some basic info (grabbed from the DB) and an image - I might opt for the tabbed window solution for this depending on the amount of content
Progress so far:
I'm the first to admit that I've progressed very little in 3 days :o :( I guess I should emphasise at this point that whilst I'm more than happy coding in XHTML and CSS, my .asp skills are "developing" and my JavaScript skills are pretty much nill (I can read it, and get the gist of what's going on, but I can't code in it yet)
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(54.162433999999998, -3.6474609999999998), 4);
//listen for clicks (** This bit works - do not remove yet **)
GEvent.addListener(map, "click", function(overlay, point) {
if (overlay) {
map.removeOverlay(overlay);
} else {
map.addOverlay(new GMarker(point));
}
});
}
}
//]]>
</script>
So as you can see - so far all I've managed to do is allow users to add / remove an unlimited number of markers... which isn't very helpful at all :(
I've checked out the tutorials, and have posted on the Google Discussion Board (only had 1 reply there so far), and checked out a few other sites, but just keep coming up against the same problems - which is that most sites assume that you have a good knowledge of JavaScript and API's - there doesn't seem to be any such thing as a real "beginner's guide"
Any ideas?
If someone could just let me know how to go about:
a) finding out the location of a marker when it's been placed
b) how to save this using .asp (i.e. to I somehow just assign this to a variable?)
c) how I can limit the marker to just one per user
... that should be enough to get me going again.
I'm not after someone to create all of the code for me (although if someone already has the code and want's to share it I certainly wouldn't mind ;) ) but I'm more than happy to learn if I can get a pointer in the right direction.
Thanks
Kessa