PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
modules
define(['module/base'],function(base) { return createModuleDefinition([base], function($file_manager,$dialog, pageEdit_event) { this.initializeData = { address:'Berkeley,CA', zoom:13, description:'Enter description here' }; this.getData = function() { var data = this.module_data; var mapElement = this.getElement().children('.map'); var map = mapElement.data('map'); if(map!=undefined) { data.lat = map.center.lat(); data.lng = map.center.lng(); data.zoom = map.zoom; } console.log(map); return data; }; this.onloadHtmlCompleted = function() { var google = pageEdit_event.iframe.iframe.google; if(google!= undefined) pageEdit_event.iframe.getWindow().initializeMap(); }; this.controller = function($scope, $moduleInstance) { var google = pageEdit_event.iframe.iframe.google; $scope.searchMap = function() { var google = pageEdit_event.iframe.iframe.google; $moduleInstance.module_data = $scope.data; var t = $moduleInstance.getElement(); var mapdiv = t.find('.map'); var map = $moduleInstance.map || mapdiv.data('map'); var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': $scope.data['address']}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { //$scope.data.lat = results[0].geometry.location.lat(); //$scope.data.lng = results[0].geometry.location.lng(); map.setCenter(results[0].geometry.location); var marker = $moduleInstance.marker || mapdiv.data('marker'); marker.setPosition( results[0].geometry.location ); var infowindow = $moduleInstance.infowindow || mapdiv.data('infowindow'); infowindow.open(map, marker); infowindow.setContent( $scope.data['description'] ); $moduleInstance.infowindow = infowindow; mapdiv.data('infowindow', infowindow); } else { alert("Geocode was not successful for the following reason: " + status); } }); }; $scope.changeDescription = function() { $moduleInstance.module_data = $scope.data; var t = $moduleInstance.getElement(); var mapdiv = t.find('.map'); var infowindow = $moduleInstance.infowindow || mapdiv.data('infowindow'); infowindow.setContent($scope.data['description']); }; }; }); });
[+]
..
[-] productlist.js
[edit]
[-] facebookvideo.js
[edit]
[-] newslist.js
[edit]
[-] image.js
[edit]
[-] video.js
[edit]
[-] button.js
[edit]
[-] zone.js
[edit]
[-] text.js
[edit]
[-] newscategory.js
[edit]
[-] googlemap.js
[edit]
[-] base_structure.js
[edit]
[-] contactform.js
[edit]
[-] spacer.js
[edit]
[-] infobox.js
[edit]
[-] html.js
[edit]
[-] testmodule.js
[edit]
[-] facebookcomment.js
[edit]
[-] iframe.js
[edit]
[-] twitterfeed.js
[edit]
[-] recentnews.js
[edit]
[-] audio_player.js
[edit]
[-] slick.js
[edit]
[-] newsdetail.js
[edit]
[-] facebookpost.js
[edit]
[-] pagezone.js
[edit]
[-] panigation.js
[edit]
[-] row.js
[edit]
[-] __custom_module_template.js
[edit]
[-] carousel.js
[edit]
[-] icon.js
[edit]
[-] typedtext.js
[edit]
[-] newscomment.js
[edit]
[-] box.js
[edit]
[-] base_custom.js
[edit]
[-] wordpress.js
[edit]
[-] base.js
[edit]
[-] column.js
[edit]
[-] fancytext.js
[edit]
[-] recentproduct.js
[edit]
[-] statcounter.js
[edit]
[-] tab.js
[edit]
[-] bootstrap_slider.js
[edit]
[-] ihover.js
[edit]
[-] line.js
[edit]
[-] blogger.js
[edit]
[-] slideshow.js
[edit]
[-] title.js
[edit]
[-] facebookpage.js
[edit]
[-] share_buttons.js
[edit]
[-] facebooklike.js
[edit]
[-] infobanner.js
[edit]
[-] rssfeed.js
[edit]
[-] flash.js
[edit]
[-] countdown.js
[edit]
[-] facebooksend.js
[edit]
[-] mailchimp.js
[edit]
[-] infotable.js
[edit]
[-] navbar.js
[edit]
[-] cycleslider.js
[edit]
[-] modal.js
[edit]
[-] embed.js
[edit]
[-] alert.js
[edit]
[-] progress_bar.js
[edit]
[-] accordion.js
[edit]
[-] youtube.js
[edit]
[-] social_buttons.js
[edit]
[-] productcategory.js
[edit]
[-] menu.js
[edit]
[-] pricetable.js
[edit]
[-] productdetail.js
[edit]
[-] gallery.js
[edit]