Google Maps API level-1: Display in-picture in googlemaps

Source: Internet
Author: User
From: http://hi.baidu.com/xfm_zhr/blog/item/b210c3035b1f888fd53f7c2b.html

Show the picture in Google Maps.

Method: You can edit an appropriate HTML statement and call gmarker. showmapblowup () to display the small map.

Gmarker. showmapblowup (OPTs );

Opts: ginfowindowsoptions object. Includes six attributes. Selectedtab number, indicating the number of the selected tag. It starts from 0 and is only valid for the Information Window of multiple tags. Maxwidth, the maximum width of the information window, And the pixel value. Onopenfn function, which is called when the information window is opened. Onclosefn function, called when the information window is closed. Zoomlevel number, which is only valid for the showmapblowup () method and specifies the zoom level of a small map. Maptype, A gmaptype object, which is only valid for the showmapblowup () method and specifies the map type of a small map.

The gmap2 object has a similar method.

Gmap2.showmapblowup (point, opts );

Point: glatlng object, small map center.

Opts: ginfowindowsoptions object.

ExampleCode:

If (gbrowseriscompatible ()){

Map = new gmap2 (document. getelementbyid ("map "));

Map. addcontrol (New gsmallmapcontrol ());

Map. addcontrol (New gmaptypecontrol ());

VaR geopoint = new glatlng (39.92, 116.46 );

Map. setcenter (geopoint, 4 );

//Create a landmark like a magnifier

VaR myicon = new gicon ();

Myicon. Image = "magnifier.gif ";

Myicon. Shadow = "shadow.gif ";

Myicon. iconsize = new gsize (44, 44 );

Myicon. shadowsize = new gsize (1, 1 );

Myicon. iconanchor = new gpoint (18, 20 );

Myicon. infographic wanchor = new gpoint (15, 18 );

VaR magnifier = new gmarker (geopoint,

{Icon: myicon,

Draggable: True,

Title :"Please drag the magnifier to the location where you want to view the satellite map"

});

Map. addoverlay (magnifier );

//Display the satellite chart at the end of the drag-and-drop operation

Gevent. addlistener (magniier, "dragend", function ()

{

VaR zoom = map. getzoom ();

Magniier. showmapblowup ({zoomlevel: Zoom, maptype: g_satellite_map });

});

}

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.