Google. Small examples of GIS

Source: Internet
Author: User

var map; var array = [[41.774166667, 85.943055556], [43.864052, 87.560499]];//latitude and longitude var array1 = ["Location 1", "Location 2"]; var latitude = 0; var longitude = 0; var markersarray = []; var title = "Xinjiang";  var openinfo = "";     function Initialize () {var i = 0;     var k = 0; var mylatlng = new Google.maps.LatLng (41.774166667, 85.943055556); Initial position var myoptions = {Zoom:8,//Map zoom level CENTER:MYLATLNG,//Map Center location mapTypeId:google.ma Ps.           Maptypeid.roadmap,//constant roadmap with a map display constant satellite for satellite display DISABLEDOUBLECLICKZOOM:TRUE//disable double-click Zoom Map};                 Bind the map to the DIV with id map_canvas map = new Google.maps.Map (document.getElementById ("Map_canvas"), myoptions); The loop populates the data into a new marker object for (i = 0; i < Array.Length; i++) {var mylatlng = new Google.maps.La         TLNG (Array[i][k], array[i][k + 1]);//reposition//Display information openinfo = Array1[i]; Flag icon showing the address var marker = new Google.maps.Marker ({posiTION:MYLATLNG, Map:map, icon: ' http://www.yiyacn.com/uploads/tubiaoimg/icon/fatcow_02         7.png '//Custom Tag icon});         Marker.settitle (title);     Alerttitle (marker, openinfo);           };   Infowindow.open (map);     Display prompt main window when loading var Infowindow;     var infowindow2; Prompt Information window function alerttitle (marker, OpenInfo) {//hover on the tag to open the Prompt information window Google.maps.event.addLis             Tener (marker, ' mouseover ', function (event) {infowindow2 = Infowindow;                 Infowindow = new Google.maps.InfoWindow ({content:openinfo, position:mylatlng             });             if (infowindow2! = null) {infowindow2.close ();                       } infowindow.open (map, marker);                   }); The mouse left tag closes the prompt message window//google.maps.event.addlistener (marker, ' mouseout ', function (event) {//infowindow.close (    );     //});           }; Add double-click event Google.maps.event.addDomListener (Map, ' DblClick ', function (event) {Placemarker (event) to map.         LATLNG);               Creatediv (EVENT.LATLNG);           });         Add a new Identity function Placemarker (location) {if (infowindow2! = null) {infowindow2.close ();         } if (Infowindow! = null) {infowindow.close ();                 } marker = new Google.maps.Marker ({position:location, Map:map,                               Title:title, Icon: ' http://www.yiyacn.com/uploads/tubiaoimg/icon/fatcow_027.png '//Custom marker icon         });         Clearoverlays (); Markersarray.push (marker); Add the Marker object to the Markersarray array map.setcenter (location); Reposition Center}//Create operation layer function Creatediv (location) {var array = location.tostring (). spli T (","); Latitude var contentstring = ' <div id= ' ContenT "> ' + ' <div id=" sitenotice "> ' + ' </div> ' + ' 

  

Google. Small examples of GIS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.