PATH:
home
/
letacommog
/
letaweb
/
admin
/
modules
/
googlemap
<script type="text/javascript"> window.initializeMap = function() { window.maps = window.maps || []; console.log('maps-API has been loaded, ready to use'); for(var i =window.maps.length-1; i >=0;i--) { if(initMap(window.maps[i].id, window.maps[i].center,window.maps[i].zoom,window.maps[i].description)) window.maps.splice(i,1); } } function initMap(id, center,zoom,description) { console.log("initMap"); try { if(google == undefined || google.maps == undefined) return; var map_element = $('#' + id); var map_element_width = map_element.width(); var map_element_height = map_element.height(); if(map_element_width == 0 || map_element_height == 0 ) { if(map_element_width == 0) { var p_map_element_width = map_element.parent().width(); map_element_width = p_map_element_width; map_element.width(map_element_width); } if(map_element_height == 0) { map_element.height(map_element_width * 9 / 16); } } var marker; var map; var map = new google.maps.Map(document.getElementById(id), { center: center, zoom: zoom }); marker = new google.maps.Marker({ map:map, draggable: true, animation: google.maps.Animation.DROP, position: center }); var infowindow = new google.maps.InfoWindow({ content: description, }); infowindow.open(map, marker); google.maps.event.addListener(marker, 'click', function() { if (marker.getAnimation() != null) { marker.setAnimation(null); } else { marker.setAnimation(google.maps.Animation.BOUNCE); } }); google.maps.event.addListener(marker, 'drag', function() { var pos = marker.getPosition(); infowindow.setPosition(pos); }); google.maps.event.addListener(marker, 'dragend', function() { var c = marker.getPosition(); this.map.setCenter(c); }); google.maps.event.addListener(map, 'zoom_changed', function() { var c = this.getCenter(); this.setCenter(c); }); map_element.data('map', map); map_element.data('marker', marker); map_element.data('infowindow', infowindow); return true; } catch(e) { return false; } return false; } function registerMap(id, center,zoom,description) { console.log("registerMap"); window.maps = window.maps || []; window.maps.push({id:id, center:center,zoom:zoom,description:description}); initializeMap(); } </script> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=<?php echo Yii::app()->params['google_api_key'] ?>&sensor=true&callback=initializeMap" ></script>
[+]
..
[-] frontend_class.php
[edit]
[-] frontend_script.php
[edit]
[-] backend.php
[edit]
[-] backend.js
[edit]
[-] frontend_view.php
[edit]