yugalatea / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

Cannot create new marker icon based on DEFAULT_ICON #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
0.290, 1.0 RC

Detailed description:
When trying to create a new marker icon based on DEFAULT_ICON, many of the 
default definitions are lost. For 
example, the icon size is no longer set to 32x32, and if setting the size 
manually, the icon and shadow no 
longer start from the same origin.

Code: 

final MapWidget map = new MapWidget();
map.setPixelSize(400, 400);
RootPanel.get().add(map);

map.addMapClickHandler(new MapClickHandler() {
    public void onClick(MapClickEvent event) {
        if (event.getOverlay() != null) {
            return;
        }
        Icon icon = Icon.newInstance(Icon.DEFAULT_ICON);
        icon.setImageURL("http://www.google.com/intl/en_us/mapfiles/ms/micons/yellow.png");
        MarkerOptions options = MarkerOptions.newInstance(icon);
        final Marker m = new Marker(event.getLatLng(), options);
        map.addOverlay(m);
    }
});

Workaround if you have one:
Using MapIconMaker from the gmaps-utility-library

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by tom...@gmail.com on 11 Oct 2008 at 9:31

GoogleCodeExporter commented 9 years ago
I figured out what the problem is.
The default icon is 20x34, while the other icons (such as the one in the example
above) are 32x32.

It would be nice to provide the users with consistent icon sizes, but anyway - 
this
is not a bug.

Original comment by tom...@gmail.com on 12 Oct 2008 at 8:13

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 13 Oct 2008 at 3:53