[OpenLayers-Users] Google Maps using api 3

Rohan Parkes rohan.parkes at pelicancorp.com
Wed Jun 23 02:24:25 EDT 2010


I was trying the patch. It seems to break for me in FF 3+ - overlays and
controls disappear. They appear briefly sometimes when I interact with the
map.

Moreover, I noticed also that my WMS overlays developed an "elastic" quality
in all browsers - when panning, they would drag slightly behind the base map
and then catch up after the pan was complete.

However, what I actually wanted the 3 API for was for Styled Map Types. I
was trying to adapt the Google code example:

var stylez = [{
      featureType: "road.local",
      elementType: "geometry",
      stylers: [{
        hue: "#00ff00"
      },{
        saturation:100  
      }]
    }
];

  map = new google.maps.Map(document.getElementById("map_canvas"),
      mapOptions);

  var styledMapOptions = {
      map: map,
      name: "Hip-Hop"
  }

  var jayzMapType =  new google.maps.StyledMapType(stylez,styledMapOptions);

  map.mapTypes.set('hiphop', jayzMapType);
  map.setMapTypeId('hiphop');

by creating a Google 3 layer, and getting a reference to the actual Google
map object using

lyrBaseGoogleStreet.mapObject

and using that to apply the styles. i.e. from the above, I was using

lyrBaseGoogleStreet.mapObject.mapTypes.set('hiphop', jayzMapType);

Again, I kept finding that the style would appear momentarily when the map
loaded, then vanish, leaving the standard Google base map. This happened in
all browsers.

Rohan Parkes
PelicanCorp 


-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
Behalf Of christopher.schmidt at nokia.com
Sent: Thursday, 17 June 2010 00:32
To: woodbri at swoodbridge.com
Cc: users at openlayers.org
Subject: Re: [OpenLayers-Users] Google Maps using api 3


On Jun 16, 2010, at 10:27 AM, ext Stephen Woodbridge wrote:

> Hi devs,
> 
> FYI:
> 
> It looks like google has a fix in place to disable animation on 
> setCenter, is:
> 
> http://code.google.com/p/gmaps-api-issues/issues/detail?id=2346
> 
> I think that this was the blocking item for implementing a Google layer 
> provider in OL using the Gmaps 3 api.
> 
> I might have misunderstood, but you might be interested in this change 
> if you have not been tracking the bug.

I believe Tim has already noted this in the corresponding trac ticket:

http://trac.openlayers.org/ticket/2493#comment:6

Regards,
-- 
Christopher Schmidt
Nokia

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users




More information about the Users mailing list