Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
- <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
- function initialize() {
- var latlng = new google.maps.LatLng(0, 40);
- var settings = {
- zoom: 2,
- center: latlng,
- mapTypeControl: true,
- mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
- navigationControl: true,
- navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
- var map = new google.maps.Map(document.getElementById("map_canvas"), settings);
- ....
- }
- function initialize2() {
- var latlng = new google.maps.LatLng(0, 40);
- var settings = {
- zoom: 2,
- center: latlng,
- mapTypeControl: true,
- mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
- navigationControl: true,
- navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL},
- mapTypeId: google.maps.MapTypeId.ROADMAP
- };
- var map2 = new google.maps.Map(document.getElementById("map_canvas2"), settings);
- ...
- }
- var geocoder;
- var map;
- function codeAddress<? echo $post['Post']['id']; ?>() {
- var address = "<? echo h($post['Post']['address']); ?>, <? echo h($post['Post']['ZIP']); ?> <? echo $cities[$post['Post']['city_id']]; ?>";
- geocoder.geocode( { 'address': address}, function(results, status) {
- if (status == google.maps.GeocoderStatus.OK) {
- map<? echo $post['Post']['id']; ?>.setCenter(results[0].geometry.location);
- var marker = new google.maps.Marker({
- map: map<? echo $post['Post']['id']; ?>,
- position: results[0].geometry.location
- });
- } else {
- alert('Geocode was not successful for the following reason: ' + status);
- }
- });
- }
- function initialize<? echo $post['Post']['id']; ?>() {
- geocoder = new google.maps.Geocoder();
- var latlng = new google.maps.LatLng(-34.397, 150.644);
- var mapOptions = {
- zoom: 14,
- center: latlng
- }
- map<? echo $post['Post']['id']; ?> = new google.maps.Map($('googleMap<? echo $post["Post"]["id"]; ?>'), mapOptions);
- codeAddress<? echo $post['Post']['id']; ?>()
- }
- google.maps.event.addDomListener(window, 'load', initialize<? echo $post['Post']['id']; ?>);
Add Comment
Please, Sign In to add comment