CodeAve.com CodeAve.com - Maps - Google Maps
ASP
JavaScript
CSS
HTML
Maps
·Map Script Writers
·Bing Maps
·Google Maps
·Contents
Links
Mail List
Search
Sitemap


 


Basic Google Map (v3) Sourced from KML File
KML (Keyhole Markup Language) files can be used as the source for your Google Maps. You can simply link your KML (or KMZ) file through Google Maps directly via a URL like this http://maps.google.com/maps?q=http://codeave.com/maps/state_capitols.kml or the KML can be embedded into your web page. Below is an example that utilizes a KML file that has the locations and icons for all 50 US state Capitols and all of the basic code needed to embed it within your page. The KML file is available to view within Google Earth or download from this location http://codeave.com/maps/state_capitols.kml
View the Output
Text View
Print View
Mail this Link

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>CodeAve.com/Maps - Google Map with KML Source</title>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<!-- Reference to the map control -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<!-- A sensor value is required. True indicates that your application is using a sensor
(such as a GPS locator) to determine the user's location. False indicates that you are not-->
<script type="text/javascript">
function initialize() {
var myOptions =
{
mapTypeId: google.maps.MapTypeId.ROADMAP
// sets the type of map to be displayed
// HYBRID - displays a transparent layer of major streets on satellite images
// ROADMAP - displays a normal street map
// SATELLITE - displays satellite images
// TERRAIN - displays maps with physical features such as terrain
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

var KML_Layer = new google.maps.KmlLayer('http://codeave.com/maps/state_capitols.kml');
KML_Layer.setMap(map);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>

<!-- http://maps.google.com/maps?q=http://codeave.com/maps/state_capitols.kml -->

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved