Permalink
Browse files

Update Bing Maps to V8

  • Loading branch information...
sixeyed committed Aug 10, 2018
1 parent 6091b69 commit 1e124ca63c9b63bdc795d4a303ee9d2edc0b933c
@@ -4,6 +4,10 @@ NerdDinner._map = null;
NerdDinner.ipInfoDbKey = '';
NerdDinner.BingMapsKey = '';

NerdDinner.InitMap = function () {
NerdDinner.LoadMap(null, null);
};

NerdDinner.LoadMap = function (latitude, longitude) {
var mapOptions = {
credentials: NerdDinner.BingMapsKey,
@@ -20,11 +24,13 @@ NerdDinner.LoadMap = function (latitude, longitude) {
NerdDinner._map.setView({ center: new Microsoft.Maps.Location(latitude, longitude) });
}
};

NerdDinner.ClearMap = function () {
if (NerdDinner._map !== null) {
// NerdDinner._map.entities.clear();
}
};

NerdDinner.LoadPin = function (location, _id, _title, _description, _draggable) {
var pinInfobox = new Microsoft.Maps.Infobox(location, { id: _id, title: _title, description: _description, visible: false });

@@ -90,10 +90,6 @@

<script type="text/javascript">
//<![CDATA[
$(document).ready(function () {
onMapLoaded();
});
function onMapLoaded() {
$("#Address").blur(function (evt) {
//If it's time to look for an address,
@@ -37,7 +37,8 @@

@section Scripts {
<script type="text/javascript">
$().ready(function () {
function onMapLoaded() {
yepnope({
test: Modernizr.geolocation,
yep: '@Url.Content("~/Scripts/geo.js")',
@@ -54,7 +55,7 @@
ValidateAndFindDinners();
}
});
});
}
function OnNavigation() {
NerdDinner.LoadMap(null, null);
@@ -3,20 +3,12 @@
<head>
<title>@ViewBag.Title</title>
<meta name="viewport" content="width=device-width">

<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.bing.com https://*.virtualearth.net http://*.bing.com http://*.virtualearth.net http://api.ipinfodb.com" />
@Styles.Render("~/Content/jquerymobile")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jquerymobile")
@Scripts.Render("~/bundles/yepnope")

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script type="text/javascript" src="~/Scripts/NerdDinner.js"></script>

<script type="text/javascript">
NerdDinner.ipInfoDbKey = '@NerdDinner.Env.IpInfoDbKey';
NerdDinner.BingMapsKey = '@NerdDinner.Env.BingMapsKey';
</script>
</head>
<body>
<div data-role="page" data-theme="b">
@@ -29,5 +21,18 @@
<div data-role="footer">
</div>
</div>

<script type="text/javascript" src="~/Scripts/NerdDinner.js"></script>
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=GetMap&branch=release' async defer></script>

<script>
function GetMap() {
NerdDinner.ipInfoDbKey = '@NerdDinner.Env.IpInfoDbKey';
NerdDinner.BingMapsKey = '@NerdDinner.Env.BingMapsKey';
NerdDinner.InitMap();
onMapLoaded();
}
</script>

</body>
</html>
@@ -5,27 +5,21 @@
<title>@ViewBag.Title</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.bing.com https://*.virtualearth.net http://*.bing.com http://*.virtualearth.net http://api.ipinfodb.com" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/knockout")
@Scripts.Render("~/bundles/yepnope")

<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
<script type="text/javascript" src="~/Scripts/NerdDinner.js"></script>

<script type="text/javascript">
NerdDinner.ipInfoDbKey = '@NerdDinner.Env.IpInfoDbKey';
NerdDinner.BingMapsKey = '@NerdDinner.Env.BingMapsKey';
</script>
</head>
<body>
<header>
<div class="content-wrapper">
<div class="float-left">
<p class="site-title">
<a href="~/" title="Nerd Dinner">
<img src="~/Images/Logo.png" style="border: none;" /></a>
<img src="~/Images/Logo.png" style="border: none;" />
</a>
</p>
</div>
<div class="float-right">
@@ -52,15 +46,28 @@
<div class="content-wrapper">
<div class="float-left">
Code by <a href="http://www.hanselman.com">Hanselman</a>, <a href="http://weblogs.asp.net/scottgu">Guthrie</a>, <a href="http://weblogs.asp.net/jgalloway">Galloway</a>, <a href="http://mourfield.com">Mourfield</a>,<a href="http://www.johnvpetersen.com"> Petersen</a> and <a href="http://blog.nerdbank.net/">Arnott</a>. JavaScript
by <a href="http://encosia.com">Dave Ward</a>. ASP.NET MVC by <a href="http://www.haacked.com">Haack</a> and friends. Style by <a href="http://michaeldorian.com/">Michael Dorian Bach</a>.<br />
by <a href="http://encosia.com">Dave Ward</a>. ASP.NET MVC by <a href="http://www.haacked.com">Haack</a> and friends. Style by <a href="http://michaeldorian.com/">Michael Dorian Bach</a>.<br />
Source Code at <a href="http://nerddinner.codeplex.com">http://nerddinner.codeplex.com</a>.
Free Sample Book Chapter and code walkthrough at <a href="http://tinyurl.com/aspnetmvc">http://tinyurl.com/aspnetmvc</a>.
Free Sample Book Chapter and code walkthrough at <a href="http://tinyurl.com/aspnetmvc">http://tinyurl.com/aspnetmvc</a>.
<br />
Version: @HttpContext.Current.Application["Version"]
</div>
</div>
</footer>

<script type="text/javascript" src="~/Scripts/NerdDinner.js"></script>
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?callback=GetMap&branch=release' async defer></script>

<script>
function GetMap() {
NerdDinner.ipInfoDbKey = '@NerdDinner.Env.IpInfoDbKey';
NerdDinner.BingMapsKey = '@NerdDinner.Env.BingMapsKey';
NerdDinner.InitMap();
onMapLoaded();
}
</script>

@RenderSection("scripts", required: false)

</body>
</html>

0 comments on commit 1e124ca

Please sign in to comment.