googlemap

来源:互联网 发布:移动网络100m测速图片 编辑:程序博客网 时间:2024/04/26 21:26

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestMap1.aspx.cs" Inherits="TestMap1" %>

<!--
  copyright (c) 2009 Google inc.

  You are free to copy and use this sample.
  License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.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 type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js'></script>

    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg" type="text/javascript"></script>
 
    <script type="text/javascript">
    function mainaerMarker(latlngPoint,dataItem,msgContentHtml)
    {
            this.point = latlngPoint;
            this.data =  dataItem ;
            this.msgContent =  msgContentHtml ;
    }
        mainaerMarker.prototype = new GOverlay() ;
        
        mainaerMarker.prototype.initialize = function(map)
        {
         
            var div = document.createElement("div");
            div.style.position = "absolute";
            var src1 = "http://www.mainaer.com/skin/maps/" + this.data.ProductID + ".png"
            var src2 = "http://www.mainaer.com/skin/maps/" + this.data.ProductID + "_R.png";
            var htmlMsg =  this.msgContent;
            var img = document.createElement("img");
            img.src = src1;
            GEvent.addDomListener(img, "click", function() {
                 alert(htmlMsg );
            });
            GEvent.addDomListener(img, "mouseout", function() {
                img.src = src1;
            });
            GEvent.addDomListener(img, "mouseover", function() {
                img.src = src2;
            });
            div.appendChild(img);
            map.getPane(G_MAP_MAP_PANE).appendChild(div);
            this.map_ = map;
            this.div_ = div;
        }
        mainaerMarker.prototype.remove = function() {
            this.div_.parentNode.removeChild(this.div_);
        }
        mainaerMarker.prototype.copy = function() {
            return new mainaerMarker(this.point, this.data, this.msgContent);
        }
        mainaerMarker.prototype.redraw = function(force) {
             if ( force) {
                var c1 = this.map_.fromLatLngToDivPixel(this.point);
                this.div_.style.left = c1.x + "px";
                this.div_.style.top = c1.y + "px";
            }
        }
   
    </script>
  <script>  
    function initialize()
    {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
   
        // Display a rectangle in the center of the map at about a quarter of
        // the size of the main map
        var  data =[{"NodeID":3,"NodeName":"上城区","NodeIdentifier":"shangchengqu","ProductID":4,"Jd":"120.175181329250340000","Wd":"30.246977535048234000","MapH":40,"MapW":61,"ProductName":"通润银座","ProductIntro":"作为酒店式公寓项目,通润银座集合了LOFT精装修公寓、写字楼、临街商铺等多元产品于一体,将呈现一座尊荣、便捷、有品位的建筑。","Sale_Phone":"400-12345678","Price":"20000","Address":"上城区西湖大道与佑圣观路交叉口"},{"NodeID":3,"NodeName":"上城区","NodeIdentifier":"shangchengqu","ProductID":10,"Jd":"120.200742781162260000","Wd":"30.244444957300388000","MapH":40,"MapW":67,"ProductName":"康都.紫轩","ProductIntro":"康都·紫轩位于秋涛路与甬江路交汇口,占据钱江新城核心生活区位,南倚钱塘江,北眺都市繁华,800米生活圈内学校、超市、运动场馆、休闲中心一应俱全。","Sale_Phone":"","Price":"25000","Address":"秋涛路与甬江路交界处"},{"NodeID":3,"NodeName":"上城区","NodeIdentifier":"shangchengqu","ProductID":22,"Jd":"120.169535279273980000","Wd":"30.253196323667104000","MapH":40,"MapW":61,"ProductName":"东方金座","ProductIntro":"东方金座位于杭州平海路、岳王路、仁和路的黄金交汇处,地处新湖滨商圈的核心地带,总建筑面积5万余平方米。得享市中心核心交通网络*西湖边的标志性建筑,国际著名设计大师的经典力作,强大的贵族生活休闲配套,彰显国际级高尚物业的附加值","Sale_Phone":"","Price":"26000","Address":"城区岳王路1号"},{"NodeID":4,"NodeName":"下城区","NodeIdentifier":"xiachengqu","ProductID":44,"Jd":"120.170433819293970000","Wd":"30.294034987452150000","MapH":40,"MapW":92,"ProductName":"野风.现代景苑","ProductIntro":"","Sale_Phone":"0571-85382972/85382973","Price":"21000","Address":"拱墅现代雅苑以北,绍兴路以西"},{"NodeID":9,"NodeName":"西湖区","NodeIdentifier":"xihuqu","ProductID":60,"Jd":"120.065460205078120000","Wd":"30.288458025628610000","MapH":40,"MapW":73,"ProductName":"坤和西溪里","ProductIntro":"坤和·西溪里秉承“得意而忘形”的理念,领悟中式内涵,读透现代居住需求,将项目定位为“现代中式墙门大宅”。项目将以现代中式的手法演绎墙门大宅,以小景、雅街、幽巷、静院、敞屋等墙门空间元素再现纯正杭州生活,结合立面线条、空间尺度、色彩规划、生态科技等呼应现代生活,打造素墙幽弄、抄手游廊、前庭后院的现代中国人家。","Sale_Phone":"0571-8515773785150028","Price":"20000","Address":"文一西路蒋村西路交汇处"},{"NodeID":9,"NodeName":"西湖区","NodeIdentifier":"xihuqu","ProductID":63,"Jd":"120.136120319366450000","Wd":"30.289301075085140000","MapH":40,"MapW":92,"ProductName":"金都.城市芯宇 ","ProductIntro":"","Sale_Phone":"0571-86581888、86581999","Price":"30000","Address":"西湖文一路与教工路交叉路口东北侧"},{"NodeID":9,"NodeName":"西湖区","NodeIdentifier":"xihuqu","ProductID":84,"Jd":"120.139575004577630000","Wd":"30.283566342949240000","MapH":40,"MapW":61,"ProductName":"兰庭国际","ProductIntro":"","Sale_Phone":"0571-88825766/87661666","Price":"24000","Address":"西湖文二路与保俶路交叉口"},{"NodeID":27,"NodeName":"江干区","NodeIdentifier":"jiangganqu","ProductID":112,"Jd":"120.230603814125060000","Wd":"30.312192655905754000","MapH":40,"MapW":61,"ProductName":"原筑壹号  ","ProductIntro":"","Sale_Phone":"0571-88115533,88115522","Price":"16000","Address":"原筑壹号位于江干德胜立交西北侧(新火车东站东北侧)"},{"NodeID":25,"NodeName":"拱墅区","NodeIdentifier":"gongshuqu","ProductID":148,"Jd":"120.085364878177640000","Wd":"30.325503672199776000","MapH":40,"MapW":61,"ProductName":"红杉雅园","ProductIntro":"","Sale_Phone":"0571-88976060、88979090","Price":"60000","Address":"红杉雅园位于拱墅杭州市拱墅区环镇北路长阳路口"},{"NodeID":25,"NodeName":"拱墅区","NodeIdentifier":"gongshuqu","ProductID":156,"Jd":"120.144510269165040000","Wd":"30.302825932775466000","MapH":40,"MapW":135,"ProductName":"远洋杭州大运河商务区","ProductIntro":"","Sale_Phone":"0571-88028686","Price":"35000","Address":"丽水路101号(紫荆公园南侧)"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":161,"Jd":"119.975370168685910000","Wd":"30.228052295020347000","MapH":40,"MapW":92,"ProductName":"金成.庭院深深","ProductIntro":"","Sale_Phone":"0571-87187500、87187550、88600888","Price":"8000","Address":"余杭区西溪湿地延伸带、杭徽高架余杭出口处"},{"NodeID":25,"NodeName":"拱墅区","NodeIdentifier":"gongshuqu","ProductID":169,"Jd":"120.116875469684600000","Wd":"30.295341173539840000","MapH":40,"MapW":92,"ProductName":"恒策.西城时代","ProductIntro":"","Sale_Phone":"0571-87208111,87208110","Price":"12000","Address":"恒策西城时代位于拱墅拱墅区登云路与隐秀路交叉口"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":193,"Jd":"120.019433498382570000","Wd":"30.209661175050207000","MapH":40,"MapW":86,"ProductName":"绿野春天东区 ","ProductIntro":"","Sale_Phone":"0571-85128801/85128802","Price":"5800","Address":"余杭区小和山高教园区西南角,留和路延伸段"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":211,"Jd":"119.979986250400540000","Wd":"30.268560882146896000","MapH":40,"MapW":61,"ProductName":"青枫墅园","ProductIntro":"","Sale_Phone":"0571-87975228/87975338","Price":"11000","Address":"余杭区文一西路延伸段南侧"},{"NodeID":28,"NodeName":"滨江区","NodeIdentifier":"binjiangqu","ProductID":227,"Jd":"120.153409838676450000","Wd":"30.160731254114612000","MapH":40,"MapW":61,"ProductName":"金盛曼城","ProductIntro":"","Sale_Phone":"0571-8661266686618000","Price":"12000","Address":"滨江区东冠路655号"},{"NodeID":28,"NodeName":"滨江区","NodeIdentifier":"binjiangqu","ProductID":234,"Jd":"120.136742591857910000","Wd":"30.180636311291142000","MapH":40,"MapW":92,"ProductName":"贺田尚城.璟湾","ProductIntro":"","Sale_Phone":"0571-8763099886611668","Price":"20000","Address":"滨江六和路,新生路(六和塔正对面)"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":251,"Jd":"120.311204195022580000","Wd":"30.409997617477240000","MapH":40,"MapW":98,"ProductName":"华鼎君临天下城","ProductIntro":"","Sale_Phone":"0571-8616333386163388","Price":"13000","Address":"余杭区东至东湖路,南至翁梅路,西至南大街,北至迎体路"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":253,"Jd":"120.270080566406250000","Wd":"30.473532229270802000","MapH":40,"MapW":117,"ProductName":"欣北.钱江国际广场","ProductIntro":"","Sale_Phone":"0571-89023000、89025558","Price":"6180","Address":"顺风路与兴元路交汇的西南角"},{"NodeID":9,"NodeName":"西湖区","NodeIdentifier":"xihuqu","ProductID":268,"Jd":"120.053658485412600000","Wd":"30.242232084337647000","MapH":40,"MapW":79,"ProductName":"西溪.君逸汇","ProductIntro":"","Sale_Phone":"0571-87206008/87206009","Price":"8000","Address":"留下街道,北依西溪路,南望午潮山国家森林公园"},{"NodeID":27,"NodeName":"江干区","NodeIdentifier":"jiangganqu","ProductID":329,"Jd":"120.286109447479250000","Wd":"30.307151640744983000","MapH":40,"MapW":92,"ProductName":"德信.泊林印象","ProductIntro":"德信·泊林印象19、20号地块位于杭州市九堡中心区,是九堡目前配套最成熟的板块,拥有丰富的交通资源和教育资源:毗邻地铁一号线九堡中心站、交通便捷。西南角为已建幼儿园,地块南侧为30班小学,北侧为规划36班小学、小区绿地、9班幼儿园等。地块东至26000余方的规划绿地,南至九乔路及沿河绿化地,西至兴安路,北至九恒路。周边拥有50米宽的绿化带与河道,景观资源更加丰富。","Sale_Phone":"0571—86922527","Price":"23000","Address":"杭州市九堡镇兴安路与九乔路交叉口"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":344,"Jd":"120.295615196228030000","Wd":"30.400936372743990000","MapH":40,"MapW":73,"ProductName":"东海水景城","ProductIntro":"东海水景城,总占地330亩,位于杭州临平世纪大道以南、西安路以东,近邻迎宾大道和临丁路快速城市道路,离规划中的临平地铁站口800米左右。社区低密度建筑和高绿化率园林相呼应,由内向外自然交汇。运动休闲空间和商业场所被立体生态园林所贯穿,形成了开放性的交流空间,将不同的职能区间和空间构成一个完整、自然、健康、和谐的居住氛围,创造了“有人、有景、有情、有味…”的人文生活社区。","Sale_Phone":"0571-89182666,87901088","Price":"13000","Address":"东海水景城位于余杭临平世纪大道,西安路以东"},{"NodeID":31,"NodeName":"富阳市","NodeIdentifier":"fuyang","ProductID":349,"Jd":"119.970174729824060000","Wd":"30.059632129001040000","MapH":40,"MapW":67,"ProductName":"万科.公望","ProductIntro":"","Sale_Phone":"0571-6177199987977555","Price":"5000","Address":"杭州市杭富沿江公路黄公望森林公园南麓"},{"NodeID":27,"NodeName":"江干区","NodeIdentifier":"jiangganqu","ProductID":359,"Jd":"120.201711058616640000","Wd":"30.229989709954978000","MapH":40,"MapW":92,"ProductName":"绿城.蓝色钱江","ProductIntro":"","Sale_Phone":"0571-87902666/87901599","Price":"29000","Address":"之江路与望江东路交叉口"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":361,"Jd":"119.947145283222200000","Wd":"30.268296795145290000","MapH":40,"MapW":86,"ProductName":"西城时代家园","ProductIntro":"","Sale_Phone":"0571-87017680、88652708","Price":"8200","Address":"西城时代家园位于余杭文一西路与狮山路交汇处南侧"},{"NodeID":27,"NodeName":"江干区","NodeIdentifier":"jiangganqu","ProductID":364,"Jd":"120.222184360027310000","Wd":"30.253671289477967000","MapH":40,"MapW":86,"ProductName":"万银国际大厦","ProductIntro":"","Sale_Phone":"0571-8696500086432222","Price":"20000","Address":"钱江新城核心区"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":365,"Jd":"119.926025569438930000","Wd":"30.240345889408647000","MapH":40,"MapW":73,"ProductName":"新西湖小镇","ProductIntro":"","Sale_Phone":"0571-87758687/87758689","Price":"6700","Address":"余杭区中泰乡"},{"NodeID":29,"NodeName":"余杭区","NodeIdentifier":"yuhangqu","ProductID":377,"Jd":"119.981788694858550000","Wd":"30.226624701694724000","MapH":40,"MapW":86,"ProductName":"金成竹海水韵","ProductIntro":"","Sale_Phone":"0571-85856777/87187500","Price":"11500","Address":"余杭区西溪湿地延伸带、天目山路延伸段北"},{"NodeID":34,"NodeName":"淳安县","NodeIdentifier":"chunan","ProductID":382,"Jd":"119.042696356773370000","Wd":"29.605327155176220000","MapH":40,"MapW":129,"ProductName":"绿城.千岛湖度假公寓","ProductIntro":"","Sale_Phone":"0571-64828888/87902666","Price":"25000","Address":"淳安千岛湖镇东北部"},{"NodeID":34,"NodeName":"淳安县","NodeIdentifier":"chunan","ProductID":384,"Jd":"119.204621315002440000","Wd":"29.496810170935074000","MapH":40,"MapW":104,"ProductName":"通盛.翡翠岛别墅","ProductIntro":"","Sale_Phone":"0571-8790161664880666","Price":"15000","Address":"千岛湖城区中心位置"},{"NodeID":34,"NodeName":"淳安县","NodeIdentifier":"chunan","ProductID":386,"Jd":"119.031774401664730000","Wd":"29.587853968473403000","MapH":40,"MapW":154,"ProductName":"嘉豪.景月湾花苑(售完)","ProductIntro":"","Sale_Phone":"0571-64991588","Price":"1850","Address":"淳安临岐镇"},{"NodeID":34,"NodeName":"淳安县","NodeIdentifier":"chunan","ProductID":387,"Jd":"119.054524898529050000","Wd":"29.596138483431652000","MapH":40,"MapW":104,"ProductName":"千岛龙庭 (售完)","ProductIntro":"","Sale_Phone":"0571-64888999,82890758","Price":"7000","Address":"千岛龙庭位于淳安千岛湖镇环湖南路1号"},{"NodeID":34,"NodeName":"淳安县","NodeIdentifier":"chunan","ProductID":388,"Jd":"119.046065211296080000","Wd":"29.614556962645345000","MapH":40,"MapW":61,"ProductName":"金色阳光 ","ProductIntro":"","Sale_Phone":"0571-64817711,64827711","Price":"11000","Address":"金色阳光位于淳安千岛湖镇阳光路"}];
       
        for(var i=0;i<data.length ;i++)
        {
            var cd= data[i] ;
            var p1=  new GLatLng(cd.Wd,cd.Jd);
            var r=new mainaerMarker(p1,cd ,cd.ProductName);
            if(i == 0)
            {
                map.setCenter(p1,13);
            }
            map.addOverlay( r);         
       }
    }
    </script>

</head>
<body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;">
    <div id="map_canvas" style="width: 800px; height: 600px"></div>
    <div id="testDirectCallHtmlContent"></div>
</body>
</html>

原创粉丝点击