Yes but the BIG problem of goggle documentation is that the examples
code are always made with random position of the points and i not have
a random position...
The code is very different and i not say where exactly modify my code
(with a fix position) with the google example... If i just add the
"Create a base icon for all of our markers that specifies the
shadow, icon dimensions, etc." section to my code it nor work. Like
this:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/
>
<title>Google Maps JavaScript API Example: Simple Map</title>
<script src="http://maps.google.com/maps?
file=api&v=2&key=ABQIAAAAuXCsgtFbun9VDKmTtofpsRT1j4YpvHOHiC5kQPc9yCF7N4lTLBSI53SaDUC21NIY0fFfohMMCuCkvA"
type="text/javascript"></script>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.addMapType(G_PHYSICAL_MAP) ;
map.addControl(new GSmallZoomControl());
map.setCenter(new GLatLng(75.27268, 17.024919),
1,G_PHYSICAL_MAP);
// Create a base icon for all of our markers that specifies the
// shadow, icon dimensions, etc.
var baseIcon = new GIcon(G_DEFAULT_ICON);
baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
baseIcon.infoWindowAnchor = new GPoint(9, 2);
map.addOverlay(new GMarker(new GLatLng(78.37268,17.024919)));
}
}
</script>
</head>
<body onload="initialize()" onunload="GUnload()">
<div id="map_canvas" style="width: 300px; height: 130px"></div>
</body>
</html>
On 24 juil, 12:32, Pil <[email protected]> wrote:
> Did you read the posting guide lines?
> Have you seen the documentation?
>
> http://code.google.com/apis/maps/documentation/javascript/v2/overlays...
>
> On Jul 24, 11:25 am, Fabrizio <[email protected]> wrote:
>
> > Can any one tell me what and were i need to add to the below code to
> > have a custom GMarker (house_icon.png) icon in place of the standard
> > GMarker ?
> > I try to search in the precedent post but if i just add this:
>
> > var icon = new GIcon();
> > icon.image = "house_icon.png";
> > icon.shadow = "house_icon_shadow.png";
> > icon.iconSize = new GSize(50, 50);
> > icon.shadowSize = new GSize(50, 50);
> > icon.iconAnchor = new GPoint(7, 7);
> > icon.infoWindowAnchor = new GPoint(12,2);
>
> > It not work :(
>
> > Thank you in advance for your help.
>
> > My gmaps code:
>
> > <title>Google Maps JavaScript API Example: Simple Map</title>
> > <script src="http://maps.google.com/maps?
> > file=api&v=2&key=ABQIAAAAuXCsgtFbun9VDKmTtofpsRT1j4YpvHOHiC5kQPc9yCF7N4lTLBSI53SaDUC21NIY0fFfohMMCuCkvA"
> > type="text/javascript"></script>
> > <script type="text/javascript">
>
> > function initialize() {
> > if (GBrowserIsCompatible()) {
> > var map = new GMap2(document.getElementById("map_canvas"));
> > map.addMapType(G_PHYSICAL_MAP) ;
> > map.addControl(new GSmallZoomControl());
> > map.setCenter(new GLatLng(40.122781,9.13968),
> > 4,G_PHYSICAL_MAP);
> > map.addOverlay(new GMarker(new GLatLng(40.122781,9.13968)));
>
> > }
> > }
>
> > </script>
> > </head>
> > <body onload="initialize()" onunload="GUnload()">
> > <div id="map_canvas" style="width: 300px; height: 130px"></div>
> > </body>
> > </html>
--
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en.