Google Map for My Blog

本文介绍如何使用Google地图API在个人网站上嵌入交互式地图。通过简单的JavaScript代码和API密钥,您可以轻松地将地图集成到网页中,并添加标记及路线等功能。

 Google Map for My Blog

Author: ZhangGuiQuan

KeyWords: Google Map and Wibsite

Google Maps is a  very cool webgis Application,basing on some traditional web and maps technologies and the popular web tchnology Ajax, whitch is considered as the core technoloy of the web 2.0. It's a useful tools for the native people and a gift for the human beings. Through the google maps application you can search locations as you want and as a GIS tool to navigate your driving and any other thing. Google Maps API have being a part of the Google Open Source Program and it available on website : http://www.google.com/apis/maps/ new.  Though Google Maps is a  very complex application,you can create simple applications by the standard API and some JavaScript technologies. Start now, to create you own map.

The Google Maps API lets you embed Google Maps in your own web pages with JavaScript. You can add overlays to the map (including markers and polylines) and display shadowed "info windows" just like Google Maps.

If you want to Put Google Maps on Your Own Web Site Sign up for a Google Maps API key  here.The Maps API is a free beta service, available for any web site that is free to consumers. Please see the terms of use for more information.To use the Maps API on an intranet or in a non-publicly accessible application, please check out Google Maps for Enterprise.

The following is a example of the process to useing the google map, just as a demo for my blog.

Your key is:

ABQIAAAAHNY_AU0cvcSGXupctRLBdhRgv5BhoHLEsxzNIZ_***
(The starts are omited for some reason)

This key is good for all URLs in this directory:

http://blog.youkuaiyun.com/natureboy520/

Here is an example web page to get you started on your way to mapping glory:

 

<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
< html  xmlns ="http://www.w3.org/1999/xhtml" >
  
< head >
    
< meta  http-equiv ="content-type"  content ="text/html; charset=utf-8" />
    
< title > Google Maps JavaScript API Example </ title >
    
< script  src ="http://maps.google.com/maps?file=api&amp;v=2&amp;     
       key=ABQIAAAAHNY_AU0cvcSGXupctRLBdhRgv5BhoHLEsxzNIZ_***     
      CSgRTCceBGl4YYpLxlYffPx_WObcQTyw"
      type
="text/javascript" ></ script >
    
< script  type ="text/javascript" >
    
//<![CDATA[
    function load() {
      
if (GBrowserIsCompatible()) {
        
var map = new GMap2(document.getElementById("map"));
        map.setCenter(
new GLatLng(37.4419-122.1419), 13);
      }

    }

    
//]]>
    
</ script >
  
</ head >
  
< body  onload ="load()"  onunload ="GUnload()" >
    
< div  id ="map"  style ="width: 500px; height: 300px" ></ div >
  
</ body >
</ html >

 

 A Graphic from the demo application as follows:

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值