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

dcabasson denis.cabasson at gmail.com
Thu Sep 8 23:49:47 EDT 2011


Thanks for your answer, Stephen.

However, you are mistaking my point. I understand that open layer is a
client side library. I am just saying that open layer might (/could/should)
be smart enough to detect that my base layer is a google layer and decide at
that point (or at least leave me the option through a configuration element)
to defer to the Google server the rendering of the KML layer.

Typically, I would want to have an option on the open layer map saying
deferKmlToServerSide = true which when activated and when using a Google
base layer (or any other layer where the server side resolution of the KML
is possible), would defer the KML overlay to the server side.

I am not recommending to always resolve the KML on the server side (which
obviously is impossible for a client side library), just to leave the option
to do it when the actual implementation offers that possibility. 

Denis.


Stephen Woodbridge wrote:
> 
> 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
> 
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
> 


--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Open-Layers-and-KML-overlays-tp6773787p6774730.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list