Google Map question
Hi everyone, its great to find a place like this. Congratulations
I'm looking for some help as I'm trying to make a link to a map using this:
var buceriasHTML = '<img src="images/rn-bucerias.jpg" height="80" width="80" style="float: left; margin-right: 20px" /><strong>Bucerías,<br />Nayarit</strong>';
<li><a onclick="findAddress('Bucerias, Nayarit, MX',buceriasHTML)" style="color: #009; text-decoration: underline; cursor ointer">Bucerías, Nayarit</a></li>
Everything works fine BUT, I'm looking to get a zoom value to the map when the user clicks on the link.
Is that possible?
Will you share with me the code I need to get the proper zoom value for the link? (probably street view will be the best option)
Thanks in advance for your help and/or pointing me to the right direction.
Jesus
Sorry, I should had used the code tag
Code:
var buceriasHTML = '<img src="images/rn-bucerias.jpg" height="80" width="80" style="float: left; margin-right: 20px" /><strong>Bucerias,<br />Nayarit</strong>';
<li><a onclick="findAddress('Bucerias, Nayarit, MX',buceriasHTML)" style="color: #009; text-decoration: underline; cursorointer">Bucerias, Nayarit</a></li>
GoogleMaps uses z=1 to z=19 for zoom.
Yes, I know, this does not contain any useful information from which you can easily
incorporate into your own script. But that's the point. You have given us so little
information that it is almost impossible to figure out what you are trying to do.
Thanks for your answer DracoMerest.
I'll try to explain it better.
I'm trying to add to the onclick function the zoom value I need for that specific place. Do you think that possible?
(to add the zoom value to this line of code:
Code:
<li><a onclick="findAddress('Bucerias, Nayarit, MX',buceriasHTML)" style="color: #009; text-decoration: underline; cursorointer">Bucerias, Nayarit</a></li>
Thanks for your help!
Jesus
One line of HTML is not enough.
What does the function findAddress() do?
Here's the code:
Code:
function findAddress(address, HTML) {
if (HTML === undefined) {
HTML = "<strong>" + address + "</strong>";
}
markerHTML = HTML;
var geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
addressSet = 1;
startAddress = address;
searchCenter = results[0].geometry.location;
createMarker(searchCenter, 0, markerHTML, "pin");
var trafficLayer = new google.maps.TrafficLayer();
trafficLayer.setMap(map);
getCategories(0);
if (mapExtra === true) {
mapPost();
}
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
Thanks again for your help!
I must say here, that I'm using the onclick code to get different links to different places.
So, what I'm trying to do with the zoom its to give individual zoom value per place as, in some cases, smaller cities needs more zoom than big cities. I hope this make this more clear.
Different zoom value per onclick link and each onclick link will open a new map.
Jesus
Ah, now I understand.
http://code.google.com/apis/maps/doc...ion/index.html
There is even a discussion forum devoted to google maps.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks