forked from DNNCommunity/Dnn.WebAnalytics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Map.ascx.cs
50 lines (46 loc) · 1.34 KB
/
Map.ascx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using DotNetNuke.Services.Exceptions;
using System;
using DotNetNuke.Web.Client.ClientResourceManagement;
namespace Dnn.WebAnalytics
{
public partial class Map : ModuleBase
{
public string GoogleAPIKey
{
get
{
if (!string.IsNullOrEmpty((string)Settings["google_api_key"]))
{
return (string)Settings["google_api_key"];
}
else
{
return string.Empty;
}
}
}
protected new void Page_Load(Object sender, EventArgs e)
{
try
{
base.Page_Load(sender, e);
ClientResourceManager.RegisterScript(this.Page, ResolveUrl("https://maps.googleapis.com/maps/api/js?key=" + GoogleAPIKey), 20);
}
catch (Exception ex)
{
Exceptions.ProcessModuleLoadException(this, ex);
}
}
protected string ApiUrlBase
{
get
{
if (DotNetNuke.Application.DotNetNukeContext.Current.Application.CurrentVersion.Major < 9)
{
return "/desktopmodules/Dnn.WebAnalytics/api";
}
return "/api/Dnn.WebAnalytics";
}
}
}
}