text: ﻿/*
  BingMap.js v1.1 Authored By: Prashant Khandelwal
  Webpage: http://midnightprogrammer.net/bingmapjs/
  */
  (function (a) { a.fn.extend({ BingMap: function (b) { var c = { Height: 400, Width: 400, APIKEY: "", Address: "", Latitude: "", Longitude: "", Title: "", Description: "", ZoomLevel: 4, MapMode: "2D", MapStyle: "Aerial", PushPin: true, ShowDashBoard: true, ShowScaleBar: true, DashBoardStyle: "Normal", AllowMouseWheelZoom: true }; var b = a.extend(c, b); return this.each(function () { var c = a(this); var d = b; a(c).css("width", d.Width + "px"); a(c).css("height", d.Height + "px"); a(c).css("position", "relative"); var e; var f; if (d.Address.length > 0) { a.ajax({ url: "http://dev.virtualearth.net/REST/v1/Locations", dataType: "jsonp", async: false, data: { key: d.APIKEY, q: d.Address }, jsonp: "jsonp", success: function (a) { var b = a.resourceSets[0].resources[0].point.coordinates; e = b[0]; f = b[1] } }) } a.getScript("http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.3", function () { map = new VEMap(a(c).attr("id")); var b; var g; if (d.Latitude.length == 0 && e.toString().length > 0) { b = e } else { b = "" } if (d.Longitude.length == 0 && f.toString().length > 0) { g = f } else { g = "" } var h = d.Title; var i = d.Description; var j = d.ZoomLevel; var k = d.MapMode; var l = d.MapStyle; var m = d.PushPin; var n = d.ShowDashBoard; var p = d.ShowScaleBar; var q = d.DashBoardStyle; var r = d.AllowMouseWheelZoom; if (b.length == 0 || g.length == 0) { if (n == true) { if (q == "Tiny") { map.SetDashboardSize(VEDashboardSize.Tiny) } else if (q == "Small") { map.SetDashboardSize(VEDashboardSize.Small) } else { map.SetDashboardSize(VEDashboardSize.Normal) } } else { map.HideDashboard() } map.LoadMap(); if (k == "2D") { map.SetMapMode(VEMapMode.Mode2D) } else { map.SetMapMode(VEMapMode.Mode3D) } if (l == "Road") { map.SetMapStyle(VEMapStyle.Road) } else if (l == "Birdseye") { map.SetMapStyle(VEMapStyle.Birdseye) } else if (l == "Hybrid") { map.SetMapStyle(VEMapStyle.Hybrid) } else { map.SetMapStyle(VEMapStyle.Aerial) } if (p == true) { map.ShowScalebar() } else { map.HideScalebar() } map.SetMouseWheelZoomToCenter(r) } else { var s = new VELatLong(b, g); if (n == true) { if (q == "Tiny") { map.SetDashboardSize(VEDashboardSize.Tiny) } else if (q == "Small") { map.SetDashboardSize(VEDashboardSize.Small) } else { map.SetDashboardSize(VEDashboardSize.Normal) } } else { map.HideDashboard() } map.LoadMap(s, j, VEMapStyle.Aerial); if (k == "2D") { map.SetMapMode(VEMapMode.Mode2D) } else { map.SetMapMode(VEMapMode.Mode3D) } if (l == "Road") { map.SetMapStyle(VEMapStyle.Road) } else if (l == "Birdseye") { map.SetMapStyle(VEMapStyle.Birdseye) } else if (l == "Hybrid") { map.SetMapStyle(VEMapStyle.Hybrid) } map.SetMouseWheelZoomToCenter(r); if (m == true) { var t = new VEShape(VEShapeType.Pushpin, s); t.SetCustomIcon(null); t.SetTitle(h); t.SetDescription(i); map.AddShape(t) } } }) }) } }) })(jQuery)