Monday, October 30, 2006

'load' GEvent of overview map

Oh yes. I took time to enhance the event test page. I will publish 2.0 beta very soon. During testing I made some discovery.

It has been a common practice to apply a small delay when setting the initial map type or position of overview map.

I happened to find a GEvent 'load' that is probably intended for the purpose.

var ovMap=new GOverviewMapControl();
map.addControl(ovMap);
var mini=map.getOverviewMap();

GEvent.addListener(mini,"load",function(){
mini.setZoom(14);
mini.setMapType(G_SATELLITE_MAP);
});
Seems to work perfect.

Saturday, October 28, 2006

GEvents

There is an easy to read section in api.js. The one where string variables are introduced (2.67):

var Bb="newcopyright";
var mf="blur";
var X="click",
bd="contextmenu",
Ca="dblclick";
var nf="error";
var ce="keydown",
de="keypress",
of="keyup",
cd="load",
Da="mousedown",
xc="mousemove",
Ea="mouseout",
Ma="mouseup",
he="mousewheel",
ie="DOMMouseScroll";
var sf="unload",
yc="remove",
Va="mouseover",
Yd="closeclick",
fe="maximizeclick",
ke="restoreclick",
ge="maximizeend",
rf="restoreend",
pf="maxtab",
Wd="animate",
Vd="addmaptype",
lf="addoverlay",
Xd="clearoverlays",
Zd="infowindowbeforeclose",
be="infowindowprepareopen",
$d="infowindowclose",
ae="infowindowopen",
Kb="maptypechanged",
qa="moveend",
Lb="movestart",
je="removemaptype",
qf="removeoverlay",
Wa="resize",
tf="zoom",
dd="zoomend",
le="zooming",
me="zoomrangechange",
ne="zoomstart",
ub="dragstart",
tb="drag",
Ua="dragend",
vb="move",
wc="clearlisteners";
var vc="changed";
var ee="logclick";

Most of them are known GEvents but there are a few strings that I have no idea about. They are not necessarily GEvents but it is very easy to try that. I have to find time to create the event test pages further on. For instance info window has GEvents now.

Tuesday, October 17, 2006

More custom legends

Tooltips of map type buttons are here again. We had them in v1 and now in v2,65. When trying to find how to modify their contents I found many other parameters too.

_mPanNorth, _mPanWest, _mPanEast, _mPanSouth (Arrow button tooltips)
_mLastResult (Return button tooltip)
_mZoomIn, _mZoomOut (Zoom button tooltips)
_mMapMode (Map button legend)
_mMapModeShort (Map legend of small button)
_mStreetMapAlt (Map button tooltip)
_mMapError (Error message of uncovered areas)
_mSatelliteMode (Sat button legend)
_mSatelliteModeShort (Sat legend of small button)
_mSatelliteMapAlt (Sat button tooltip)
_mSatelliteError (Error message of uncovered areas)
_mHybridMode (Hyb button legend)
_mHybridModeShort (Hyb legend of small button)
_mHybridMapAlt (Hyb button tooltip)

Syntax as in previous post.

Update 2008. These variables have gone a long time ago.

Sunday, October 15, 2006

Custom type button legends



Add this script right after your Maps API call:
<script>
_mMapMode = "Karta";
_mMapModeShort = "Karta";
_mSatelliteMode = "Sputnik";
_mSatelliteModeShort = "Sput";
_mHybridMode = "Gibrid";
_mHybridModeShort = "Gib";
GLoadMapsScript();
<\script>

An example.

The trick was presented by Alexander on the forum.

var blog = new collectionOfTricks();

A blog is the most convenient notebook. This is my notebook for Google Maps API code snippets and tricks.

The first one is a method to edit the legends of map type buttons.