123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- var Bizgaze;
- (function (Bizgaze) {
- let Apps;
- (function (Apps) {
- let Communications;
- (function (Communications) {
- let Meetings;
- (function (Meetings) {
- let Components;
- (function (Components) {
- class MeetingAddress extends Unibase.Platform.Core.BaseComponent {
- cssFiles() {
- return [];
- }
- jsFiles() {
- return ["apps/communications/meetings/managers/meetingmanager.js"];
- }
- html(id, containerid) {
- var html = `<div class="card">
- <div class="card-title">
- <a class="btn btn_Listsearch_angle">
- <i class="fa fa-angle-down hidden"></i>
-
- <span id="hf_widget_title_MeetingAddress">Meeting Address</span>
- </a>
- <div class="" style="padding-bottom:10px"></div>
-
- <div id="meetingAddressMap" class="text-center b-a" style="height: 250px;">
- </div>
- <div class="" style="padding-bottom:10px"></div>
- <div class="wrapper-sm">
- <label id="mapaddress" style="padding-left:10px"></label>
- </div>
-
- </div>
- </div>`;
- return html;
- }
- load(id, containerid, callback) {
- id = Unibase.Themes.Providers.DetailHelper.recordId;
- let instance = this;
- instance.MeetingAddress(id);
- }
- init(containerid) {
- var instance = this;
- instance.fileCacheHelper.loadJsFiles(["apps/communications/meetings/components/meetingaddress.js", "apps/communications/meetings/managers/meetingmanager.js"], function () {
- instance.navigationHelper.loadSection(0, containerid, Bizgaze.Apps.Communications.Meetings.Components.MeetingAddress.Instance(), null, null);
- });
- }
- MeetingAddress(id) {
- var instance = this;
- Bizgaze.Apps.Communications.Meetings.Managers.MeetingManager.Instance().getMeeting(id).then(function (response) {
- if (response.result.MeetingLatId == "") {
- $("#meetingAddressMap").append("<li id='hours' class='list-group-item no-borders pa-5'></span>");
- $("#hours").append("<li id='hours' class='alert alert-info ma-0'>There is no Data</span>");
- }
- else if (response.result != null) {
- var latd = response.result.MeetingLatId;
- var lgtd = response.result.MeetingLngId;
- var myLatlng = new google.maps.LatLng(latd, lgtd);
- var mapOptions = {
- zoom: 8,
- center: myLatlng,
- };
- var map = new google.maps.Map(document.getElementById("meetingAddressMap"), mapOptions);
- var marker = new google.maps.Marker({
- position: myLatlng,
- title: "Hello World!",
- });
- marker.setMap(map);
- var url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + latd + "," + lgtd + "&key=" + _mapsettings.key() + "&sensor=false";
- var xhr = instance.createCORSRequest1('Get', url);
- if (!xhr) {
- bootbox.alert('CORS not supported');
- return;
- }
- xhr.onload = function () {
- var text = xhr.responseText;
- var json = JSON.parse(text);
- $("#mapaddress").text(json.results[0].formatted_address);
- };
- xhr.onerror = function () {
- bootbox.alert('Woops, there was an error making the request.');
- };
- xhr.send();
- }
- });
- }
- createCORSRequest1(method, url) {
- let XDomainRequest;
- var xhr = new XMLHttpRequest();
- if ("withCredentials" in xhr) {
- xhr.open(method, url, true);
- }
- else if (typeof XDomainRequest != "undefined") {
- xhr = new XDomainRequest();
- xhr.open(method, url);
- }
- else {
- xhr = null;
- }
- return xhr;
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new MeetingAddress();
- }
- return this.instance;
- }
- }
- Components.MeetingAddress = MeetingAddress;
- })(Components = Meetings.Components || (Meetings.Components = {}));
- })(Meetings = Communications.Meetings || (Communications.Meetings = {}));
- })(Communications = Apps.Communications || (Apps.Communications = {}));
- })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
- })(Bizgaze || (Bizgaze = {}));
|