473,322 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

multiple tags with google maps

i tried to use the multi tag function in the google maps api, but i messed it up .. it show's all "locations" but, when i click on any, it always show's the info on and from the last "location" in the Array..

anyone know's where i messed it up ?.. i cant find it

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="http://maps.googleapis.com/maps/api/js">
  5. </script>
  6.  
  7. <script>
  8. var locations = [
  9.       ["<a href='http://www.rome.de'>Rome</a>", 50.002485, 8.554255, 4],
  10.       ["<a href='http://www.athen.de'>Athen</a>", 50.002485, 8.554255, 5],
  11.       ['Autohaus Gotta', 49.998909, 8.588143, 3],
  12.       ['Friedhof', 50.007880, 8.572271, 2],
  13.       ['Gundbach', 50.002485, 8.554255, 1]
  14. ];
  15. var mapPosition =  new google.maps.LatLng(49.990594, 8.573357);
  16. // var myCenter=new google.maps.LatLng(50.009088, 8.578590);
  17. // var myCenter=new google.maps.LatLng(locations[0][1], locations[0][2]);
  18. var marker, i;
  19. function initialize() {
  20.   var mapProp = {
  21.     center: mapPosition,   // Die Koordinaten von Walldorf
  22.     zoom:13,  // das Zoomlevel der Karte
  23.     mapTypeId:google.maps.MapTypeId.HYBRID,  // GoogleMap Kartenart definieren (ROADMAP, HYBRID)
  24.     disableDefaultUI: true  // deaktivieren die ControlPanels
  25.   };
  26.   var map=new google.maps.Map(document.getElementById("googleMap"),mapProp);
  27. for (i = 0; i < locations.length; i++) {  
  28. var marker=new google.maps.Marker({
  29.   position:new google.maps.LatLng(locations[i][1], locations[i][2]),map: map,
  30.         clickable: true,
  31.         url: locations[i][0]
  32.   });
  33. marker.setMap(map);
  34. var infowindow = new google.maps.InfoWindow({
  35.   content:locations[i][0]});
  36. google.maps.event.addListener(marker, 'click', function() {
  37.    infowindow.open(map,marker);})
  38. };
  39. }
  40. google.maps.event.addDomListener(window, 'load', initialize);
  41. </script>
  42. </head>
  43.  
  44. <body>
  45. <div id="googleMap" style="width:500px;height:380px;"></div>
  46. </body>
  47.  
  48. </html>
  49.  
Jul 22 '15 #1
1 1973
sorry.. wrong area.. but i do not know how to transfer it into any area..
Jul 22 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Sean | last post by:
Have you ever wanted to add the great features inherent in Google Maps? Here is how you do it. ============== == STEP ONE == ============== Create a new MS Access form called frmGoogleMap....
6
by: Sam Carleton | last post by:
Ok, over the years I have read about doing web programing and I have done some real basic stuff. Now I am digging into some real ASP.Net 2.0 and am totally lost some things. I have a master...
3
by: Lemon Tree | last post by:
Hi everybody. I am new to Javascript so probably I am asking something trivial, but I cannot see where there problem is. Or, better. Maybe I know where the problem is but I cannot find a...
5
by: xml .NET group | last post by:
Is there any book on using ASP.NET for Google Maps. For example, following books: http://www.amazon.com/Beginning-Google-Maps-Applications-Ajax/dp/1590597079/ ...
6
by: mfaisalwarraich | last post by:
Hi everyone, I am trying to add multiple pinpoint to google map using Lon/Lat. All addresses will be fetched from mysql database using PHP. I have looked at google and searched for it on...
1
by: George Thompson | last post by:
i have a google maps api on my website, where when you click it grabs the lat/long coordinates and works well for me, but i would for a visual reference like to see a marker added to the place where...
0
by: Yousef Altaf | last post by:
Hi all I am working on google map api-3 and I have two interface one is inserting data to my database and second getting the data on my site from my database now everything is working fine I insert...
1
matheussousuke
by: matheussousuke | last post by:
In my page: http://sitesdemo.mghospedagem.com/ivam-entregas/3/33209.html I tried disabling a few javascript related to Google Maps, but Chrome Console is still pointing me the same errors, saying...
0
by: thoschu96 | last post by:
i tried to use the multi tag function in the google maps api, but i messed it up .. it show's all "locations" but, when i click on any, it always show's the info on and from the last "location" in...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.