Google Maps API 2.0解析(14-接口方法定义)

本文解析了Google Maps API经过代码混淆后的关键方法及其实现,包括地图操作、覆盖物管理、信息窗口控制等功能,并介绍了相关的枚举类型和类定义。
        Google为了进行代码混淆和压缩,将代码进行了变量替换,不过不管怎么替换,接口方法总要对外公开的,这儿就是进行公开的一些代码,需要注意的是这些代码在我转化之前是非常乱的,我就是根据这儿的代码进行反混淆分析的。
 
None.gif            var a;
None.gif            
//GMap2由GMapBase继承而生成
None.gif
            //g参数是一个GMapOptions,并没有在Google Maps里面定义,就通过mapTypes属性和size属性使用,因此,不能new
None.gif
            function GMap2(f,g)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif                g
=g||dot.gif{};
InBlock.gif                GMapBase.call(
this,f,g.mapTypes,g.size)
ExpandedBlockEnd.gif            }

None.gif            InheritClass(GMap2,GMapBase);
None.gif            setWindows(
"GMap2",GMap2);
None.gif            a
=GMapBase.prototype;
None.gif            setPrototype(GMapBase,
"getCenter",a.getCenter);
None.gif            setPrototype(GMapBase,
"setCenter",a.setCenter);
None.gif            setPrototype(GMapBase,
"setFocus",a.setFocus);
None.gif            setPrototype(GMapBase,
"getBounds",a.getBounds);
None.gif            setPrototype(GMapBase,
"getZoom",a.getZoom);
None.gif            setPrototype(GMapBase,
"setZoom",a.setZoom);
None.gif            setPrototype(GMapBase,
"zoomIn",a.zoomIn);
None.gif            setPrototype(GMapBase,
"zoomOut",a.zoomOut);
None.gif            setPrototype(GMapBase,
"getCurrentMapType",a.getCurrentMapType);
None.gif            setPrototype(GMapBase,
"getMapTypes",a.getMapTypes);
None.gif            setPrototype(GMapBase,
"setMapType",a.setMapType);
None.gif            setPrototype(GMapBase,
"addMapType",a.addMapType);
None.gif            setPrototype(GMapBase,
"removeMapType",a.removeMapType);
None.gif            setPrototype(GMapBase,
"getSize",a.getSize);
None.gif            setPrototype(GMapBase,
"panBy",a.panBy);
None.gif            setPrototype(GMapBase,
"panDirection",a.panDirection);
None.gif            setPrototype(GMapBase,
"panTo",a.panTo);
None.gif            setPrototype(GMapBase,
"addOverlay",a.addOverlay);
None.gif            setPrototype(GMapBase,
"removeOverlay",a.removeOverlay);
None.gif            setPrototype(GMapBase,
"clearOverlays",a.clearOverlays);
None.gif            setPrototype(GMapBase,
"getPane",a.getPane);
None.gif            setPrototype(GMapBase,
"addControl",a.addControl);
None.gif            setPrototype(GMapBase,
"removeControl",a.removeControl);
None.gif            setPrototype(GMapBase,
"showControls",a.showControls);
None.gif            setPrototype(GMapBase,
"hideControls",a.hideControls);
None.gif            setPrototype(GMapBase,
"checkResize",a.checkResize);
None.gif            setPrototype(GMapBase,
"getContainer",a.getContainer);
None.gif            setPrototype(GMapBase,
"getBoundsZoomLevel",a.getBoundsZoomLevel);
None.gif            setPrototype(GMapBase,
"savePosition",a.savePosition);
None.gif            setPrototype(GMapBase,
"returnToSavedPosition",a.returnToSavedPosition);
None.gif            setPrototype(GMapBase,
"isLoaded",a.isLoaded);
None.gif            setPrototype(GMapBase,
"disableDragging",a.disableDragging);
None.gif            setPrototype(GMapBase,
"eGEvent_moveendbleDragging",a.eGEvent_moveendbleDragging);
None.gif            setPrototype(GMapBase,
"draggingEGEvent_moveendbled",a.draggingEGEvent_moveendbled);
None.gif            setPrototype(GMapBase,
"fromContainerPixelToLatLng",a.fromContainerPixelToLatLng);
None.gif            setPrototype(GMapBase,
"fromDivPixelToLatLng",a.fromDivPixelToLatLng);
None.gif            setPrototype(GMapBase,
"fromLatLngToDivPixel",a.fromLatLngToDivPixel);
None.gif            
//GMapPane枚举的定义
None.gif
            setWindows("G_MAP_MAP_PANE",0);
None.gif            setWindows(
"G_MAP_MARKER_SHADOW_PANE",1);
None.gif            setWindows(
"G_MAP_MARKER_PANE",3);
None.gif            setWindows(
"G_MAP_FLOAT_SHADOW_PANE",4);
None.gif            setWindows(
"G_MAP_MARKER_MOUSE_TARGET_PANE",5);
None.gif            setWindows(
"G_MAP_FLOAT_PANE",6);
None.gif            a
=GMapBase.prototype;
None.gif            setPrototype(GMapBase,
"openInfoWindow",a.openInfoWindow);
None.gif            setPrototype(GMapBase,
"openInfoWindowHtml",a.openInfoWindowHtml);
None.gif            setPrototype(GMapBase,
"openInfoWindowTabs",a.openInfoWindowTabs);
None.gif            setPrototype(GMapBase,
"openInfoWindowTabsHtml",a.openInfoWindowTabsHtml);
None.gif            setPrototype(GMapBase,
"showMapBlowup",a.showMapBlowup);
None.gif            setPrototype(GMapBase,
"getInfoWindow",a.getInfoWindow);
None.gif            setPrototype(GMapBase,
"closeInfoWindow",a.closeInfoWindow);
None.gif            setPrototype(GMapBase,
"eGEvent_moveendbleInfoWindow",a.eGEvent_moveendbleInfoWindow);
None.gif            setPrototype(GMapBase,
"disableInfoWindow",a.disableInfoWindow);
None.gif            setPrototype(GMapBase,
"infoWindowEGEvent_moveendbled",a.infoWindowEGEvent_moveendbled);
None.gif            setWindows(
"GKeyboardHandler",GKeyboardHandler);
None.gif            setWindows(
"GInfoWindowTab",GInfoWindowTab);
None.gif            a
=V.prototype;
None.gif            setPrototype(V,
"selectTab",a.selectTab);
None.gif            setPrototype(V,
"hide",a.hide);
None.gif            setPrototype(V,
"show",a.show);
None.gif            setPrototype(V,
"isHidden",a.isHidden);
None.gif            setPrototype(V,
"reset",a.reset);
None.gif            setPrototype(V,
"getPoint",a.getPoint);
None.gif            setPrototype(V,
"getPixelOffset",a.getPixelOffset);
None.gif            setPrototype(V,
"getSelectedTab",a.getSelectedTab);
None.gif            setWindows(
"GOverlay",GOverlay);
None.gif            SetProperty(GOverlay,
"getZIndex",getZIndex);
None.gif            setWindows(
"GMarker",GMarker);
None.gif            a
=GMarker.prototype;
None.gif            setPrototype(GMarker,
"openInfoWindow",a.openInfoWindow);
None.gif            setPrototype(GMarker,
"openInfoWindowHtml",a.openInfoWindowHtml);
None.gif            setPrototype(GMarker,
"openInfoWindowTabs",a.openInfoWindowTabs);
None.gif            setPrototype(GMarker,
"openInfoWindowTabsHtml",a.openInfoWindowTabsHtml);
None.gif            setPrototype(GMarker,
"showMapBlowup",a.showMapBlowup);
None.gif            setPrototype(GMarker,
"getGEvent_infowindowopenon",a.getGEvent_infowindowopenon);
None.gif            setPrototype(GMarker,
"getPoint",a.getPoint);
None.gif            setPrototype(GMarker,
"setPoint",a.setPoint);
None.gif            setWindows(
"GPolyline",GPolyline);
None.gif            a
=GPolyline.prototype;
None.gif            setPrototype(GPolyline,
"getPoint",a.getPoint);
None.gif            setPrototype(GPolyline,
"getNumPoints",a.getNumPoints);
None.gif            SetProperty(GPolyline,
"fromEncoded",fromEncoded);
None.gif            setWindows(
"GGEvent_infowindowopenon",GGEvent_infowindowopenon);
None.gif            setWindows(
"G_DEFAULT_ICON",G_DEFAULT_ICON);
None.gif            
function GEvent()
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
ExpandedBlockEnd.gif            }

None.gif            setWindows(
"GEvent",GEvent);
None.gif            SetProperty(GEvent,
"addListener",addListener);
None.gif            SetProperty(GEvent,
"addDomListener",addDomListener);
None.gif            SetProperty(GEvent,
"removeListener",removeListener);
None.gif            SetProperty(GEvent,
"clearListeners",clearListeners);
None.gif            SetProperty(GEvent,
"clearInstanceListeners",clearInstanceListeners);
None.gif            SetProperty(GEvent,
"clearNode",clearNode);
None.gif            SetProperty(GEvent,
"trigger",trigger);
None.gif            SetProperty(GEvent,
"bind",bind);
None.gif            SetProperty(GEvent,
"bindDom",bindDom);
None.gif            SetProperty(GEvent,
"callback",callback);
None.gif            SetProperty(GEvent,
"callbackArgs",callbackArgs);
None.gif            
function GXmlHttp()
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
ExpandedBlockEnd.gif            }

None.gif            setWindows(
"GXmlHttp",GXmlHttp);
None.gif            SetProperty(GXmlHttp,
"create",create);
None.gif            setWindows(
"GDownloadUrl",GDownloadUrl);
None.gif            setWindows(
"GPoint",GPoint);
None.gif            a
=GPoint.prototype;
None.gif            setPrototype(GPoint,
"equals",a.equals);
None.gif            setPrototype(GPoint,
"toString",a.toString);
None.gif            setWindows(
"GSize",GSize);
None.gif            a
=GSize.prototype;
None.gif            setPrototype(GSize,
"equals",a.equals);
None.gif            setPrototype(GSize,
"toString",a.toString);
None.gif            setWindows(
"GBounds",GBounds);
None.gif            a
=GBounds.prototype;
None.gif            setPrototype(GBounds,
"toString",a.toString);
None.gif            setPrototype(GBounds,
"min",a.min);
None.gif            setPrototype(GBounds,
"max",a.max);
None.gif            setPrototype(GBounds,
"containsBounds",a.containsBounds);
None.gif            setPrototype(GBounds,
"extend",a.extend);
None.gif            setPrototype(GBounds,
"intersection",a.intersection);
None.gif            setWindows(
"GLatLng",GLatLng);
None.gif            a
=GLatLng.prototype;
None.gif            setPrototype(GLatLng,
"equals",a.equals);
None.gif            setPrototype(GLatLng,
"toUrlValue",a.toUrlValue);
None.gif            setPrototype(GLatLng,
"lat",a.lat);
None.gif            setPrototype(GLatLng,
"lng",a.lng);
None.gif            setPrototype(GLatLng,
"latRadians",a.latRadians);
None.gif            setPrototype(GLatLng,
"lngRadians",a.lngRadians);
None.gif            setPrototype(GLatLng,
"distanceFrom",a.distanceFrom);
None.gif            setWindows(
"GLatLngBounds",GLatLngBounds);
None.gif            a
=GLatLngBounds.prototype;
None.gif            setPrototype(GLatLngBounds,
"equals",a.equals);
None.gif            setPrototype(GLatLngBounds,
"contains",a.contains);
None.gif            setPrototype(GLatLngBounds,
"intersects",a.intersects);
None.gif            setPrototype(GLatLngBounds,
"containsBounds",a.containsBounds);
None.gif            setPrototype(GLatLngBounds,
"extend",a.extend);
None.gif            setPrototype(GLatLngBounds,
"getSouthWest",a.getSouthWest);
None.gif            setPrototype(GLatLngBounds,
"getNorthEast",a.getNorthEast);
None.gif            setPrototype(GLatLngBounds,
"toSpan",a.toSpan);
None.gif            setPrototype(GLatLngBounds,
"isFullLat",a.isFullLat);
None.gif            setPrototype(GLatLngBounds,
"isFullLng",a.isFullLng);
None.gif            setPrototype(GLatLngBounds,
"isEmpty",a.isEmpty);
None.gif            setWindows(
"GCopyrightCollection",GCopyrightCollection);
None.gif            a
=GCopyrightCollection.prototype;
None.gif            setPrototype(GCopyrightCollection,
"addCopyright",a.addCopyright);
None.gif            setPrototype(GCopyrightCollection,
"getCopyrights",a.getCopyrights);
None.gif            setWindows(
"GTileLayer",GTileLayer);
None.gif            setWindows(
"GMapType",GMapType);
None.gif            setPrototype(GMapType,
"getBoundsZoomLevel",GMapType.prototype.getBoundsZoomLevel);
None.gif            setPrototype(GMapType,
"getSpanZoomLevel",GMapType.prototype.getSpanZoomLevel);
None.gif            setWindows(
"GControlPosition",GControlPosition);
None.gif            
//GControlAnchor 枚举的定义
None.gif
            setWindows("G_ANCHOR_TOP_RIGHT",1);
None.gif            setWindows(
"G_ANCHOR_TOP_LEFT",0);
None.gif            setWindows(
"G_ANCHOR_BOTTOM_RIGHT",3);
None.gif            setWindows(
"G_ANCHOR_BOTTOM_LEFT",2);
None.gif            setWindows(
"GControl",GControl);
None.gif            setWindows(
"GScaleControl",GScaleControl);
None.gif            setWindows(
"GLargeMapControl",GLargeMapControl);
None.gif            setWindows(
"GSmallMapControl",GSmallMapControl);
None.gif            setWindows(
"GSmallZoomControl",GSmallZoomControl);
None.gif            setWindows(
"GMapTypeControl",GMapTypeControl);
None.gif            setWindows(
"GOverviewMapControl",GOverviewMapControl);
None.gif            a
=GOverviewMapControl.prototype;
None.gif            setPrototype(GOverviewMapControl,
"getOverviewMap",a.getOverviewMap);
None.gif            setPrototype(GOverviewMapControl,
"show",a.show);
None.gif            setPrototype(GOverviewMapControl,
"hide",a.hide);
None.gif            setWindows(
"GProjection",GProjection);
None.gif            setWindows(
"GMercatorProjection",GMercatorProjection);
None.gif            
//地图上用来进行调试输出的对象
None.gif
            function GLog()
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
ExpandedBlockEnd.gif            }

None.gif            setWindows(
"GLog",GLog);
None.gif            SetProperty(GLog,
"write",function(f,g)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
InBlock.gif                GLogBase.instance().write(f,g)
ExpandedBlockEnd.gif            }
);
None.gif            SetProperty(GLog,
"writeUrl",function(f)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
InBlock.gif                GLogBase.instance().writeUrl(f)
ExpandedBlockEnd.gif            }
);
None.gif            SetProperty(GLog,
"writeHtml",function(f)
ExpandedBlockStart.gifContractedBlock.gif            
dot.gif{
InBlock.gif                GLogBase.instance().writeHtml(f)
ExpandedBlockEnd.gif            }
)
None.gif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值