//jquery 1.2.6 doesn't provide support to getScript from the local cache
//we need to add this ourselves currently
$.getScript = function(url, callback, cache) {
$.ajax({
type: "GET",
url: url,
success: callback,
dataType: "script",
cache: cache
});
};
//our global map object
var map;
$(document).ready(function() {
// This event is fired when the DOM is fully loaded
// Is this browser supported by VE? If not why bother loading a broken control?
if (!($.browser.msie) && !($.browser.mozilla) && !($.browser.safari)) {
$("#myMap").html("Virtual Earth is not supported by your browser.")
} else {
// set a nice animated gif to show the map is loading
$("#myMap").addClass("maploading");
if (!($.browser.msie)) {
//work around for non ie
$.getScript("http://dev.virtualearth.net/mapcontrol/v6.2/js/atlascompat.js", "", true);
}
$.getScript("http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2&onScriptLoad=onscriptload", "", true);
}
});
function onscriptload() {
// get rid of our load animation
$("#myMap").removeClass("maploading");
//load the map
map = new VEMap('myMap');
map.onLoadMap = onMapLoaded;
map.LoadMap(new VELatLong( 39.027719,-97.822266), 4);
//do nothing more to the map here, use the onMapLoaded event.
var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(41.798192,-86.254005)); // Niles, MI
shape1.SetTitle('Niles, MI');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 300,000 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(38.202526,-85.549121)); // Louisville, KY
shape1.SetTitle('Louisville, KY');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 2 buildings, 172,758 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(27.973292,-82.343409)); // Tampa, FL
shape1.SetTitle('Tampa, FL');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Office/Light Industrial
Size: 1 building, 38,019 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(33.829446,-84.197309)); // Stone Mountain, GA
shape1.SetTitle('Stone Mountain, GA');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 218,725 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(33.437512,-112.232316)); // Tolleson, AZ
shape1.SetTitle('Tolleson, AZ');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 179,367 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(36.082176,-80.229485)); // Winston Salem, NC
shape1.SetTitle('Winston Salem, NC');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 2 buildings, 836,927 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(32.894291,-79.932833)); // Charleston, SC
shape1.SetTitle('Charleston, SC');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Distribution Warehouse
Size: 1 building, 124,000 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(26.024798,-80.147817)); // Hollywood, FL
shape1.SetTitle('Hollywood, FL');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Distribution Warehouse
Size: 1 building, 270,165 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(36.160867,-86.733155)); // Nashville, TN
shape1.SetTitle('Nashville, TN');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 121,658 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(35.813011,-80.952802)); // Statesville, NC
shape1.SetTitle('Statesville, NC');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 60,933 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(36.726434,-88.661063)); // Mayfield, KY
shape1.SetTitle('Mayfield, KY');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 101,244 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(41.438222,-81.655455)); // Cleveland, OH
shape1.SetTitle('Cleveland, OH');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 257,181 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(26.198804,-80.152731)); // Fort Lauderdale, FL
shape1.SetTitle('Fort Lauderdale, FL');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 2 buildings, 82,847 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(34.147524,-84.836962)); // Cartersville, GA
shape1.SetTitle('Cartersville, GA');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 208,024 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(38.212288,-85.544958)); // Jeffersontown, KY
shape1.SetTitle('Jeffersontown, KY');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 2 buildings, 172,758 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(34.00688,-118.233753)); // Vernon, CA
shape1.SetTitle('Vernon, CA');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 6 buildings, 475,532 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(39.605772,-119.203859)); // Fernley, NV
shape1.SetTitle('Fernley, NV');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 1 building, 180,400 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(38.527522,-121.520666)); // Sacramento, CA
shape1.SetTitle('Sacramento, CA');
shape1.SetCustomIcon("
");
shape1.SetDescription(".jpg)
Building Type: Light Industrial
Size: 1 building, 65,656 square feet");
map.AddShape(shape1);var shape1 = new VEShape(VEShapeType.Pushpin, new VELatLong(38.967417,-104.804764)); // Colorado Springs, CO
shape1.SetTitle('Colorado Springs, CO');
shape1.SetCustomIcon("
");
shape1.SetDescription("
Building Type: Light Industrial
Size: 4 buildings, 189,000 square feet");
map.AddShape(shape1);
}
function onMapLoaded() {
//here we can do what we want with the map object, add data etc.
}
$(window).unload(function() {
// This event is fired when the web page is closing
// Time to dispose our map
if (map) map.Dispose();
});