Hi ive already followed mike williams tutorials (well tried to). but
im very new to this and those tutorials are too advanced for me
unfortunately.im at university studying web development and have
recently gained employment as a trainee developer for a small company.
they have assigned me a task for a customer who delivers teaching
staff to anyone who needs it...ultimately the customer wants a google
map on a webpage where they can enter a postcode for a shift
location...and have all staff within a certain distance plotted around
that shift so they can choose the most appropriate one. (postcodes for
shift & staff are in database) i literally have no clue what to do so
ive tried to break this into chunks.
for now all i want to do is plot multiple locations on a map from
postcodes retrieved from database.
ive followed google tutorials in order to plot single locations and as
they are only for locations hard coded into it i had to tweak it to
get the data from database.
so i have something at the moment that allows a user to enter a staff
members name into a text field, it returns their postcode from the
database and when pressing submit it geocodes it and plots that
postcode on the map...
but obviously there can be more than one staff member with same
name...which means if someone searches for smith..and it fetches back
7 results...i need to plot 7 markers on the map.
ive tried with a loop but it changed nothing...literally did nothing
at all so ive missed something.
can someone please tell me the best way to do this? perhaps with code?
please be as simple as possible theres lots i dont understand.
Here is the small piece of code i have for geocoding and plotting that
single marker.
function codeAddress() {
var address = document.getElementById("address").innerHTML
geocoder.geocode( { 'address': address},
function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
for ( r = 0; r < results.length; ++r )
{
var marker = new google.maps.Marker
(
{ map: map,
position:
results[r].geometry.location
}
);
}
} else {
alert("Geocode was not successful for the following reason: "
+ status);
}
});
}
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.