473,750 Members | 2,209 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multiple tags with google maps

5 New Member
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 2002
thoschu96
5 New Member
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
61091
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. Size the form to your liking...
6
2988
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 page setup and that is working great. On my contact page I would like to use Google Maps API Version 2 to show a map to my location. Below is the first Google example. I would like to add this to my aspx page that is using the master page. I...
3
9618
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 solution. So, here we go... I have loaded an XML document containing a bunch of addresses. For each address I would like to put a marker on a map using the Google Maps API. In order to do so, I iterate over the address tags in the XML
5
4018
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/ http://www.amazon.com/Beginning-Google-Maps-Applications-Rails/dp/1590597877
6
16199
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 various sites but nothing helpful i found. i have used the following code which worked for only one address whereas i have alot of addresses. <!DOCTYPE html>
1
2716
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 i clicked do i know exactly where it is.. and i\'ve tried many different configurations.. any ideas? <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var geocoder;...
0
2018
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 the data to my databse and getting it but here is the problem I need to center the map on the marker key on the map here is my code to insert the data php code <?php // Gets data from URL parameters
1
4900
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 I have multiple instances of Google maps loaded. I'm getting errors like not calculating the shipping, or not being able to use the map, blah blah blah. Can anyone help me find what part of the javascript I have to edit to fix this? Here is...
0
6504
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 the Array.. anyone know's where i messed it up ?.. i cant find it <!DOCTYPE html> <html> <head> <script src="http://maps.googleapis.com/maps/api/js"> </script>
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8260
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2223
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.