bMap - Examples

1. Basic example2. Markers in constructor3. Markers, polylines & polygons
4. Marker sidebar5. Layer Sidebar6. AJAX Layers
7. Advanced AJAX8. Google Functions9. Custom Icons
10. Advanced marker events11. Image Overlay Function12. New sidebar features
V3 - Example 3V3 Example 5V3 Example 12
V3 API Custom Icons
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

Custom Marker Icon with Google Maps V3 API and bMap 1.3.1:

How its done:

To get custom markers with the V3 of the Google maps API you need to be using bMap version 1.3.1
The custom icon is used when an image URL is passed into the marker object as "icon".

<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/api/js?sensor=false" type="text/javascript"></script>
<script src="jQuery.bMap.1.3.1.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function(){ 
	$("#map1").bMap({
		mapZoom: 11,
		mapCenter:[51.501690392607,-0.1263427734375],
		markers:{"data":[ //How to immediately add markers to the map
			{
				"lat":51.49757618329838,
				"lng":-0.1746654510498047, 
				"title":"Science Museum", 
				"body":"Exhibition Road, London SW7",
				//How to use a custom marker in bMap1.3.1
				"icon":"http://www.rapidonline.com/netalogue/brands/Science%20Museum.jpg"
			},{
				"lat":51.47769451182406,
				"lng":-0.0009441375732421875, 
				"title":"Royal Observatory Greenwich", 
				"body":"Blackheath Ave, Greenwich, London SE10",
				"icon":"http://www.cod1.co.uk/forum/images/smilies/s1/telescope.gif"
			}	//keep adding as many markers as you need....
		]}
	});
});

</script>
<div style="width:80%;height:400px;margin:0 auto" id="map1">
</div>

bMap Constructor Marker Options:

markers:
	name			string		visual name for the layer, appears in layerbar
	type			string		describes the type of layer
	visible			string		("true"/"false") if the layer should start visible
	data			array		array of bMap marker objects, rendered as GMarkers
	icon			string		address of an image to use as the icon, omit for the default red pushpin



Comments:

Infowindow
Gary - 4/20/2011 8:16:03 PM
When in Google maps and a location is selected, the info window lists an option to get directions. A street view is also an option. Is it possible to do either with bMap? Thanks for bMap.. check out www.happyhourhandbook.com - Bars menu option to see my map.
Thanks
Directions
Darren - 4/22/2011 4:00:53 AM
I have not directions with V3 - but it was pretty easy in V2
http://code.google.com/apis/maps/documentation/javascript/services.html
Map Style
Tony - 6/15/2011 9:45:42 AM
Have you any plans to include the ability to add map styling to the code?

Thanks for the plugin
Map Styling
Darren - 6/24/2011 1:56:41 PM
One of the options for the bMap constructor is the mapType

The default map is shown with:
mapType: google.maps.MapTypeId.ROADMAP

but you can use the following:
ROADMAP
SATELLITE
HYBRID
TERRAIN

You can always access the google map object with bMap - so anything possible with a generic google map (from all their tutorials and examples) is also possible with bMap.
See example 8 to get an idea. The map object can be accessed here:
$('
Map Styling
Darren - 6/24/2011 1:57:30 PM
$(`map`).data('bMap').map
Map Styling
Darren - 6/24/2011 1:58:00 PM
$(`
Map Styling
Darren - 6/24/2011 1:58:45 PM
$(`.map`).data('bMap').map
(use normal quotes - my comment engine is strict!
jquery version
Tuğrul - 8/9/2011 6:19:42 AM
it don't work with jquery latest version. Can you check it?
On Load
m[e]s - 1/10/2012 1:13:16 PM
Is it possible to show title and body on load? Thanks in advance.

 (*required)
 (*private)
 (*required)
 
© 2010 blocsoft.com All Rights Reserved. GPL License Privacy Policy Contact