[OpenLayers-Users] µProblem With virtual Earth
Eric Lemoine
eric.c2c at gmail.com
Fri Feb 20 09:33:39 EST 2009
On Fri, Feb 20, 2009 at 3:20 PM, Christopher Schmidt
<crschmidt at metacarta.com> wrote:
> On Fri, Feb 20, 2009 at 10:47:53AM +0100, David Martinez Morata wrote:
>> Hello
>>
>> I'm developing a web aplication With MapFish, and I have a problem with
>> Verual Earth Layers.
>>
>> I define my layers like:
>>
>> // Google Maps Layers Definition
>> var google_hybrid = new OpenLayers.Layer.Google(
>> "GHybrid" , {type: G_HYBRID_MAP,'sphericalMercator': true}
>> );
>> var google_street = new OpenLayers.Layer.Google(
>> "GStreet", {type: G_NORMAL_MAP, 'sphericalMercator': true}
>> );
>> var google_satellite = new OpenLayers.Layer.Google(
>> "GSatellite", {type: G_SATELLITE_MAP, 'sphericalMercator': true}
>> );
>> // Add Google Maps to the map object
>> map.addLayers([google_hybrid, google_street, google_satellite]);
>> // Virtual Earth Layers Definition
>> var virtualearth_roads = new OpenLayers.Layer.VirtualEarth(
>> "VERoads",{'sphericalMercator': true, 'type':
>> VEMapStyle.Road});//Virtual Earth Roads
>> var virtualearth_aerial = new OpenLayers.Layer.VirtualEarth(
>> "VEAerial",{'type': VEMapStyle.Aerial, 'sphericalMercator':
>> true});//Virtual Earth Aerial
>> var virtualearth_hybrid = new OpenLayers.Layer.VirtualEarth(
>> "VEHybrid",{'type': VEMapStyle.Hybrid, 'sphericalMercator':
>> true});//Virtual Earth Hybrid
>> // Add Google Maps to the map object
>> map.addLayers([virtualearth_roads, virtualearth_aerial,
>> virtualearth_hybrid]);
>>
>> And When I change the view to Virtual Earth, the map changes of center
>> point.
>>
>> When I try to meauser I click in one point and the line its drawed in other
>> point (corresponding a point in google mlaps layers)
>> Any sugestion?
>
> None of the commercial layers particularly enjoy having the map div size
> changed before they're initialized (when they're not visible). Is it
> possible that MapFish is internally resizing the div before you make the
> VE layer visible?
Definitely.
--
Eric
More information about the Users
mailing list