I wanted to show different categories of information on one GMarker. That is I wanted to show different types of information on a Infowindow for a point on Google Maps. For that I used a tabbed info window, which helped me to show different data on each tabs. Here is the code of what I have done. I have shown the latitude and longitude of a placed clicked on the map on the tabbed info window. This is just the script part. The demo and download links are given below.

01 <script type="text/javascript">
02 var iconBlue = new GIcon();
05 iconBlue.iconSize = new GSize(12, 20);
06 iconBlue.shadowSize = new GSize(22, 20);
07 iconBlue.iconAnchor = new GPoint(6, 20);
08 iconBlue.infoWindowAnchor = new GPoint(5, 1);
09 var point = new GLatLng(26.88157422515243, 86.30859375);
10 function load() {
11 if (GBrowserIsCompatible()) {
12 var map = new GMap2(document.getElementById("map"));
13 map.setCenter(point,3);
14 GEvent.addListener(map, 'click', function(overlay, point) {
15 var lati=point.lat();
16 var long=point.lng();
17 var marker= new GMarker(new GLatLng(lati, long),{draggable: false});
18 map.addOverlay(marker);
19 var infoTabs = [ new GInfoWindowTab("Lat-Tab", "<h1> Latitude:</h1><br />"+lati), new GInfoWindowTab("Long-Tab", "<h1>Longitude</h1><br />"+long)];
20 marker.openInfoWindowTabsHtml(infoTabs);
21 });
22 }
23 }
24 </script>

Lets focus on the #17-#26 Lines of codes. Other Lines are already described on other posts. Please see the related post link below the post.
#17: Creates a GMarker on the point where clicked on the Map.
#18: Addes the GMarker over the Map.
#19: Initiates an array of tabsinfoTabs with GInfoWindowTab function with tabname and its innerHTML as parameters.
#20: Opens the infowindow calling openInfoWindowTabsHtml function and the array of tabs as parameters.

[Download]

Tags: , , ,

Comments are closed.


Link Exchange Spritual Place for Bhakti | bhaktiguru.com Business Franchise in India | businessfranchiseindia.com Free Directory Submission & Link Submission | ab-directory.com Big Dwarka Business Listing | bigdwarka.com Kolkata Online Business Listing | onlinekolkata.com Patna Online Business Listing | onlinepatna.com Dwarka Online Business Listing | onlinedwarka.com Bihar Online | First Bihar's Portal | bihar-online.com Big Bihar Business Listing | bigbihar.com Dynamic Website Development | dynamicwebsitedeveloper.com Noida Online Business Listing | onlinenoida.com SEO Service Delhi & India | seoservicedelhi.com SEO Experts Delhi & India | seoexpertsdelhi.com Big Patna Business Listing | bigpatna.com Bihar schools Listing Free Schools Ad | biharschools.com Creative Websoft Solutions | Web Development India | creativewebsoft.us Bulk SMS Providers India | bulksmsproviders.net Online cbse Guides | onlinecbseguides.com Big Kolkata Business Listing | bigkolkata.com Handicap Shaadi.com | handicapshaadi.com Handicap Marriage.com | handicapmarriage.com India Home Tutors.com | indiahometutors.com Indian Property Guides.com | indianpropertyguides.com Online Stocks Community.com | onlinestockscommunity.com Free Article Submission | ab-articles.com Secret Dating Online.com | secretdatingonline.com Private DatingOnline.com | privatedatingonline.com Indian businessguides.com | indianbusinessguides.com Software Engineer Delhi | Meenu Khanna Bollywood & Hot Images | hibdy.com Free Computer & Online PHP Training | php2php.com Free Ignou Project & Assignment | ignouinfo.com PHP Programmer India | Web Developer India | bageshsingh.com Creative Websoft Solutions | Web Development IndiaBlog Link Exchange http://www.php2php.com/tutorial-blog/http://bageshsingh.com/bagesh-blog/http://www.bhaktiguru.com/bhaktigurublog/http://www.hibdy.com/desi-masala-blog/