bMap - Examples
Please note that unless stated, the examples shown here use the V2 of the google maps API - and bMap version 1.2.3
There are only three examples using the V3 API - and bMap 1.3
There are only three examples using the V3 API - and bMap 1.3
New marker/sidebar features:
How its done:
In this example we can see some of the new features in bMap 1.2.2
The sidebar will scroll to the selected item if the sidebar CSS has overflow:auto set. The sidebar highlighting will also be applied if the map marker is clicked. The sidebar highlight will also be removed when the infowindow is closed. The sidebar elements get hidden/shown when the related layer is shown/hidden - see here for an example.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps?file=api&v=2&key=YOUR_GOOGLE_KEY" type="text/javascript"></script>
<script src="jQuery.bMap.1.2.3.js" type="text/javascript"></script>
<style type="text/css">
<!--
#map{ width:500px;height:500px;float:left }
#sideBar{ overflow:auto; width:200px;height:500px;text-align:center;background:#fff;float:right }
#sideBar div{ padding:2px 0; cursor:pointer }
#sideBar div:hover{ text-decoration:underline }
#buttons{ clear:both;text-align:center }
.bSideSelect{ background:#dadae3; } /* clicked items get this class */
-->
</style>
<script type="text/javascript">
$(document).ready(function(){
$("#map").bMap({
mapZoom: 8,
mapCenter:[53.611750,-9.682000],
mapSidebar:"sideBar", //id of the div to use as the sidebar
markers:{"data":[
{"lat":"53.330037","lng":"-8.219895","title":"Ballinasloe Golf Club","rnd":"1","body":"Rossglass, Ballinasloe, Co. Galway"},{"lat":"53.64748","lng":"-9.16122","title":"Ballinrobe Golf Club","rnd":"1","body":"Clooncastle, Ballinrobe, Co. Galway"},{"lat":"53.7962","lng":"-8.76869","title":"Ballyhaunis Golf Club","rnd":"1","body":"Coolnaha, Ballyhaunis, Co. Mayo"},{"lat":"53.81382","lng":"-9.57402","title":"Westport Golf Club","rnd":"1","body":"Carrowholly, Westport, Co. Mayo"},{"lat":"53.493608","lng":"-8.842259","title":"Tuam Golf Club","rnd":"1","body":"Barnacurragh, Tuam, Co. Galway, Ireland"},{"lat":"53.270665","lng":"-9.056828","title":"Taylors Hill Pitch and Putt","rnd":"1","body":"Taylors Hill, Galway"},{"lat":"53.94184","lng":"-8.94647","title":"Swinford Golf Club","rnd":"1","body":"Brabazon Park, Swinford, Co. Mayo "},{"lat":"53.614963","lng":"-8.173917","title":"Roscommon Golf Club","rnd":"1","body":"Mote Park, Roscommon, County Roscommon"},{"lat":"53.092534","lng":"-8.220778","title":"Portumna Golf Club","rnd":"1","body":"Ennis Road, Portumna, Co.Galway, Ireland"},{"lat":"53.434441","lng":"-9.319067","title":"Oughterard Golf Club","rnd":"1","body":"Oughterard, Co. Galway, Ireland"},{"lat":"53.903858","lng":"-9.789457","title":"Mulranny Golf Club","rnd":"1","body":"Mulranny, Westport, Co. Mayo"},{"lat":"53.469044","lng":"-8.506288","title":"Mount Bellew Golf Club","rnd":"1","body":"Mount Bellew, Co. Galway"},{"lat":"53.216473","lng":"-8.558865","title":"Loughrea Golf Club","rnd":"1","body":"New Inn Road, Loughrea, Co. Galway"},{"lat":"53.062374","lng":"-8.869494","title":"Gort Golf Club","rnd":"1","body":"Castlequarter, Gort, Co. Galway"},{"lat":"53.294978","lng":"-9.662819","title":"Golf Mara","rnd":"1","body":"Anach Mheain, Lettermore, Co. Galway"},{"lat":"53.271148","lng":"-9.06382","title":"Glenlo Abbey Golf Club","rnd":"1","body":"Glenlo Abbey Hotel, Bushypark, Galway"},{"lat":"53.259744","lng":"-9.094719","title":"Galway Golf Club","rnd":"1","body":"Blackrock, Salthill, Galway"},{"lat":"53.268373","lng":"-8.927266","title":"Galway Bay Golf Resort","rnd":"1","body":"Rinville, Oranmore, Co. Galway"},{"lat":"53.312242","lng":"-9.627304","title":"Connemara Isles Golf Club","rnd":"1","body":"Leitir Moir, Connemara, Co. Galway"},{"lat":"53.432817","lng":"-10.075986","title":"Connemara Golf Links","rnd":"1","body":"Aillebrack, Ballyconneely, Clifden, Co. Galway, Ireland"},{"lat":"53.72203","lng":"-8.99548","title":"Claremorris Golf Club","rnd":"1","body":"Castlemagarrett, Claremorris, Co. Mayo"},{"lat":"53.84708","lng":"-9.28841","title":"Castlebar Golf Club","rnd":"1","body":"Rocklands, Castlebar, Co. Mayo"},{"lat":"53.928552","lng":"-8.176317","title":"Carrick On Shannon Golf Club","rnd":"1","body":"Woodbrook, Carrick On Shannon, Co. Roscommon"},{"lat":"54.22695","lng":"-9.99155","title":"Carne Golf Links","rnd":"1","body":"Carne, Belmullet, Co. Mayo"},{"lat":"53.27823","lng":"-9.165551","title":"Barna Golf and Country Club","rnd":"1","body":"Corbally, Barna, Co. Galway"},{"lat":"53.972041","lng":"-10.05867","title":"Achill Golf Club","rnd":"1","body":"Keel, Achill Island, Westport, Co. Mayo"},{"lat":"53.282972","lng":"-8.845196","title":"Athenry Golf Club","rnd":"1","body":"Palmerstown, Oranmore, Co. Galway"},{"lat":"53.464037","lng":"-7.987922","title":"Athlone Golf Club","rnd":"1","body":"Hudson Bay, Athlone, Co Roscommon"},{"lat":"54.11778","lng":"-9.16757","title":"Ballina Golf Club","rnd":"1","body":"R294 Tubbercurry Road, Ballina, Co. Mayo"},{"lat":"","lng":"","title":"Thru the Links","rnd":"1","body":""},{"lat":"","lng":"","title":"Irish Gold Courses","rnd":"1","body":""},{"lat":"","lng":"","title":"Golfing Union of Ireland","rnd":"1","body":"National Headquarters, Carton Demesne, Maynooth, Co. Kildare"}
]}
});
});
</script>
<div style="width:700px;height:500px;margin:0 auto">
<div id="map"></div>
<div id="sideBar"></div>
</div>
Comments:
Markers
Darren - 8/30/2010 11:43:56 AM
I fail to see how this question relates to bMap? Unless you are asking how the sidebar works? in which case, look at the code - or better still read the google API documentation.
Darren - 8/30/2010 11:43:56 AM
I fail to see how this question relates to bMap? Unless you are asking how the sidebar works? in which case, look at the code - or better still read the google API documentation.
Customize Sidebar
iszuddin - 9/19/2010 1:14:58 AM
I am kinda new to JQuery, and definitely new to Google Map. I like your BMap so far. But I am thinking about customizing the sidebar content. ie ~ I don't want it to use the same content for sidebar and infowindow, and I'd like to be able to add buttons in the sidebar items like edit, etc. Can you help me get started.
iszuddin - 9/19/2010 1:14:58 AM
I am kinda new to JQuery, and definitely new to Google Map. I like your BMap so far. But I am thinking about customizing the sidebar content. ie ~ I don't want it to use the same content for sidebar and infowindow, and I'd like to be able to add buttons in the sidebar items like edit, etc. Can you help me get started.
Custom Sidebar
Darren - 9/19/2010 10:23:01 AM
In jquery.bmap.1.2.3.js the sidebar is built in line 191
val.title is used as the sidebar text - its the title for the marker as defined in the JSON. You could add your own extra attributes in the JSON, then use it on line 191
DArren
Darren - 9/19/2010 10:23:01 AM
In jquery.bmap.1.2.3.js the sidebar is built in line 191
val.title is used as the sidebar text - its the title for the marker as defined in the JSON. You could add your own extra attributes in the JSON, then use it on line 191
DArren

Kishan - 8/27/2010 11:37:41 PM
Hi Darren,
I have implemented this into my application and its working very fine, thanks for such a nice article.
I just want to customize this functionality little bit in such a way that , Out side of this map i want to Listing of contacts with some icons and on click of these icons i want to pop up the markers on Google Map, same as you are doing on this map.
Please let me know if you have any idea related to this. It will be great if you provide any sample code for this. Thanks in advance.
Let me know if you required more information on this.