Click here to Skip to main content
15,885,899 members
Please Sign up or sign in to vote.
3.40/5 (2 votes)
hi am using one google map plugin in my joomla3.0 project.how can i add two different location in one Google map plugin. please give solution for me

Regards
manuel john
Posted

1 solution

use this function
JavaScript
<script type="text/javascript" language="javascript">
	function showMap(lat, lng,div) {
		var latlng = new google.maps.LatLng(lat, lng);
		var mapOptions = {
			zoom: 15,
			maxZoom: 20,
			minZoom: 1,
			scrollwheel: 0,
			center: latlng,
			panControl: true,
			panControlOptions: {position: google.maps.ControlPosition.LEFT_BOTTOM},
			streetViewControl: true,
			zoomControlOptions: {style: google.maps.ZoomControlStyle.LARGE},
			mapTypeId: google.maps.MapTypeId.ROADMAP
		};
		var map = new google.maps.Map(document.getElementById(div), mapOptions);
		map.setCenter(latlng);
		var marker = new google.maps.Marker({
			map: map,
			position: latlng,
			draggable: false,
			title: 'Your title here'
		});
		
	}
</script>

and now where you have to call the methoad
you can use showMap(yourlanditude,yourlongitude,divid where you want to show the map)
for example
JavaScript
<script>
showMap(45.121371,84.79029,'map1');
</script>
 
Share this answer
 
Comments
Manuel john 14-Jun-13 3:20am    
is this possible to joomla3.0
Kislay Raj 15-Jun-13 2:42am    
yup you should create the modules or update if you have any

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900