Below is the Geo Map code I am using in my website. This code works if there is internet connection. If there is no internet connection, my code will not work.
I want to make it work without internet connection.
Please reply is there any solution for it??
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js"></script>
<script type="text/javascript">
var google_markers = new Array();
var markers = [
<asp:Repeater ID="rptMarkers" runat="server">
<ItemTemplate>
{
"title": '<%# Eval("StationName") %>',
"lat": '<%# Eval("Latitude") %>',
"lng": '<%# Eval("Longitude") %>',
"state": '<%# Eval("State") %>',
"type": 'No status'
}
</ItemTemplate>
<SeparatorTemplate>
,
</SeparatorTemplate>
</asp:Repeater>
];
</script>
<script type="text/javascript">
window.onload = function () {
var mapOptions = {
center: new google.maps.LatLng(markers[0].lat, markers[0].lng),
zoom: 9,
mapTypeId: google.maps.MapTypeId.ROADMAP,
streetViewControl: false,
mapTypeControl: true
};
var boxText = document.createElement("div");
var myOptions = {
content: boxText
, disableAutoPan: false
, maxWidth: 0
, pixelOffset: new google.maps.Size(-140, 0)
, zIndex: null
, infoBoxClearance: new google.maps.Size(1, 1)
, isHidden: false
, pane: "floatPane"
, enableEventPropagation: false
};
//var infoWindow = new google.maps.InfoWindow();
var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
var ib = new InfoBox(myOptions);
for (i = 0; i < markers.length; i++) {
var data = markers[i]
var myLatlng = new google.maps.LatLng(data.lat, data.lng);
var icon = "";
switch (data.type) {
case "Danger":
icon = "red";
break;
case "Normal":
icon = "green";
break;
case "Warning":
icon = "yellow";
break;
case "No status":
icon = "blue";
break;
}
var className = 'box ' + icon;
icon = "http://maps.google.com/mapfiles/ms/icons/" + icon + ".png";
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: data.title,
animation: google.maps.Animation.DROP,
icon: new google.maps.MarkerImage(icon),
className: className,
description: '<b>' + 'Station Name : ' + data.title +'</br>'+ 'State : ' + data.state
});
(function (marker, data) {
google.maps.event.addListener(marker, "mouseover", function (e) {
boxText.innerHTML = this.description;
boxText.className = this.className;
ib.open(map, this);
});
})(marker, data);
google.maps.event.addListener(marker, 'mouseout', function (e) {
ib.close();
});
}
}
</script>
Please reply