function moveToWorld() {
map.setCenter(new GLatLng(34, 0), 2);
}
function moveTo(latitute, longitute, zoom) {
map.setCenter(new GLatLng(latitute, longitute), zoom);
}
function addMarkerbyLatLong(latitute, longitute ,text, icon) {
var point = new GLatLng(latitute, longitute);
if (point) {
if (icon == "1") {
// Create our "tiny" marker icon
//var tinyIcon = new GIcon();
//tinyIcon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
//tinyIcon.image = "http://72.47.213.71/images/CHLA-logo-icon.png";
// Create our "tiny" marker icon
var tinyIcon = new GIcon();
tinyIcon.image = "http://lachildrenshospital.net/map/icons/blue_MarkerA.png";
tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
tinyIcon.iconSize = new GSize(20, 34);
tinyIcon.shadowSize = new GSize(22, 36);
tinyIcon.iconAnchor = new GPoint(6, 20);
tinyIcon.infoWindowAnchor = new GPoint(5, 1);
// Set up our GMarkerOptions object literal
markerOptions = { icon:tinyIcon };
var marker = new GMarker(point, markerOptions);
}
else if (icon == "2") {
// Create our "tiny" marker icon
var tinyIcon = new GIcon();
tinyIcon.image = "http://lachildrenshospital.net/map/icons/markers_chla.png";
tinyIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
tinyIcon.iconSize = new GSize(20, 34);
tinyIcon.shadowSize = new GSize(22, 36);
tinyIcon.iconAnchor = new GPoint(6, 20);
tinyIcon.infoWindowAnchor = new GPoint(5, 1);
// Set up our GMarkerOptions object literal
markerOptions = { icon:tinyIcon };
var marker = new GMarker(point, markerOptions);
}
else {
var marker = new GMarker(point);
}
GEvent.addListener(marker, "click", function() {
map.openInfoWindowHtml(point, text);
});
map.addOverlay(marker);
}
else {
alert("failed! ");
}
}
function addMarkerbyAddress(address,text) {
geocoder.getLatLng(address, function(point) {
if (point) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
map.openInfoWindowHtml(point, text);
});
map.addOverlay(marker);
}
else {
alert("failed! "+address);
}
});
}
function createMarker(point, place) {
var marker = new GMarker(point);
//marker.value = number;
GEvent.addListener(marker, "click", function() {
var myHtml = '<p style="height: 150px;max-height: 150px;overflow-y: auto;">'+place.address + '<br />' + '<strong>Country code:</strong> ' + place.AddressDetails.Country.CountryNameCode + "<br /></p>";
map.openInfoWindowHtml(point, myHtml);
});
return marker;
}
// addAddressToMap() is called when the geocoder returns an
// answer.  It adds a marker to the map with an open info window
// showing the nicely formatted version of the address and the country code.
function addAddressToMap(response) {
//map.clearOverlays();
if (!response || response.Status.code != 200) {
alert("Sorry, we were unable to geocode that address");
} else {
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1],
place.Point.coordinates[0]);
map.addOverlay(createMarker(point, place));
}
}
// showLocation() is called when you click on the Search button
// in the form.  It geocodes the address entered into the form
// and adds a marker to the map at that location.
function showLocation() {
var address = document.forms[0].q.value;
geocoder.getLocations(address, addAddressToMap);
}
// findLocation() is used to enter the sample addresses into the form.
function findLocation(address) {
document.forms[0].q.value = address;
showLocation();
}
