[OpenLayers-Users] Re: Open Layers and KML overlays

Stephen Woodbridge woodbri at swoodbridge.com
Thu Sep 8 21:06:56 EDT 2011


On 9/8/2011 8:52 PM, Stephen Woodbridge wrote:
> On 9/8/2011 5:25 PM, dcabasson wrote:
>> I have pulled together a quick example at :
>> http://dcabasson.atwebpages.com/test-kml.html
>>
>> The top map uses open layers with Google Maps (v3), while the bottom
>> one is
>> purely Google Maps (v3).
>>
>> When moving on the top map, the overlay is usually ahead of the base map,
>> which is ... disconcerting, something that does not happen on the bottom
>> map, where the overlay is added to the map on the server side by Google.
>
> Denis,
>
> I'm sure this example will be helpful to the devs and others that can
> look into the details of this, but if I step back and look at the big
> picture, I am trouble by the fact that:
>
> 1. OpenLayers is a client side only library
> 2. Google API is both a client library and server side application
>
> So if Google is solving an inherent client side performance problem by
> moving part of the solution to the server side, then I'm not sure what
> would be realist to expect from OpenLayers. I have plenty of
> applications that use pgRouting, PAGC, mapserver on the server side and
> I often write Ajax handlers to talk to other server side tools usinf
> OpenLayers API, So it seems that may be a solution is that you could
> build a small server side component, maybe in php, that takes the kml
> file and uses say a bound box strategy to return portions of it that are
> onscreen, or something like that.

So you might be able to use mapserver as your server side component to 
render you kml as tiles or images similar to how Google does it. Read this:

http://mapserver.org/input/vector/kml.html

And ask on the mapserver list if you need more help. I'm not sure off 
the top of my head if you can use cgi variable substitution to change 
the CONNECTION string to pass in a url for the kml file you want 
rendered. Again ask on the mapserver list. If not you could write a 
simple wrapper script that generates a temporary mapfile with the url 
that you need in it or something like that.

-Steve W

> I also think that if you are requesting that the OpenLayers team wrap
> all of the Google API, that that is not reasonable either. I believe I
> just saw another post over the last few days, where someone requested
> the ability to get a handle to the Google API object in OpenLayers so
> they could access Google Specific features, which might be useful to you
> but it would seem to me to defeat the goal of building vendor agnostic
> applications and maybe you would be better off just building your
> application using the Google API.
>
> Anyway, some food for thought.
>
> Best regards,
> -Steve W
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



More information about the Users mailing list