Offline Google Maps Development notes (i)

Source: Internet
Author: User

Recently made a project to use offline Google Maps development, and now Google Maps in China's development is not very perfect, resulting in the project is not decided.

Later, a map plugin Mymapw.ocx was used to perfectly solve the drawbacks of WinForm form in which webbrowse write JScript is not to be loaded.

At present, the project has been implemented, will be included in the map development part of the summary excerpt, for your reference:

1.1 Loading the Mymap.ocx map control onto a C # form

Second, the first to increase the basic operation of the map: Zoom in, zoom out, move, measure distance, measuring area

Add code to zoom in, zoom out, and move the map

private void Tsbmax_click (object sender, EventArgs e) {  mymap1.setmapoperatemode (30);//Amplified}private void Tsbmin_click (object sender, EventArgs e) {  mymap1.setmapoperatemode (20);//Narrowing}private void Tsbmove_click ( Object sender, EventArgs e) {  mymap1.setmapoperatemode (40);//move}  1.3 increase the measurement distance code private void Tsbdistance_click (object sender, EventArgs e) {  mymap1.setmapoperatemode (50);//Measurement Distance}  Add code for measuring area private void Tsbarea_click (object sender, EventArgs e) {  mymap1.setmapoperatemode (90);//Measurement Area}   Save or modify a callout point private void Btnpointsave_click (object sender, EventArgs e) {  string strresult = null; & nbsp;string strpoiname = txtpoiname.text;//name   string strlongitude = txtjd.text;  //Longitude    string strlatitude = txtwd.text;   //latitude   string strcity = ComboCity.Text;    //City   string Strminscale = cmbmin.text;  //min display level   string StrMAxscale = cmbmax.text;  //MAX display level   string Strfontname = combofont.text;      //song body   string strfontsize = combofontsize.text; Font size   string Strfrontcolor = m_color.tostring ()//FONT color   string strbmpfilename = "3.bmp";          //Mark icon belongs to filename   string strbmpindex = txtbmpindex.text;    //index in the icon file   string Strobjectid = txtinfo.text;        //The text displayed in the bubbles   string Strid = "";   int NID = 0;  if (M_pointaddoredittype = = 1)  & nbsp {//Add new callout       m_pointaddid++;      nid = m_ Pointaddid;      strid = nid.tostring ();       strresult = strresult + Strid + "," + Strpoiname + "," + strcity + "," + Strfontname + "," + Strfontsize + ","            + Strfrontcolor + "," + Strminscale + "," + Strmaxscale + "," + Strbmpfilename + "," + Strbmpindex + ","           + Strlongitude + "," + Strlatitude + "," + StrObjectID + "," + ";";   }  else if (M_pointaddoredittype = = 2)   {//Modify annotations         NID = M_pointeditid;      strid = nid.tostring ();       strresult = strresult + Strid + "," + Strpoiname + "," + strcity + "," + Strfontname + "," + Strfontsize + ","           + Strfrontcolor + "," + Strminscale + "," + StrMaxScale + "," + Strbmpfilename + "," + Strbmpindex + ","           + StrLongitude + " , "+ Strlatitude +", "+ Strobjectid +", "+"; ";   }

' Standard ' ' {' 116,lim, Qingdao, Arial, 12,0,0,500,2.bmp,4,41896957,13454163,,; '}  Mymap1.addmypoi (NID, strresult); Mymap1.drawmap ();} In the Click Trigger Event Onselectpoi function of the callout point, handle what you want to do (for example, click to Pop a form and display some information about that callout point) private void Mymap1_onselectpoi (object sender,  Axmymaplib._dmymapevents_onselectpoievent e) {int nID = E.nid;    if (!m_beditpointstate) {frmpic form = new Frmpic (NID); Form.    ShowDialog (); Mymap1.setmapoperatemode (40);//' Motion Status}} In addition, there are added roads, transparent circles, transparent polygons, transparent rectangles, arrows and other functions, the first published articles, first write so many bar, save later to organize.

Offline Google Maps Development notes (i)

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.