On Wed, Jul 6, 2016 at 4:11 PM, Milton Jonathan <milton@anonymised.com>
wrote:
Hello all, it's been a good while since I've come here
I have a (hopefully) straightforward problem at hand: I want to
efficiently display a vector layer in Google Maps that may have a very
large number of polygons. To do that, I need to load the polygons gradually
on demand as the user navigates. Having some sort of multiresolution for
the layer would be a plus, but I can also simply not show the layer if the
zoom level is too small.
My first guess to solve this problem was to have GeoServer generate a KML
super-overlay and feed that into Google Maps.
However, I was testing around with GeoServer generated KMLs and I couldn't
get even a basic KML (e.g.,
http://localhost:8080/geoserver/topp/wms/kml?layers=topp:states, which
has a NetworkLink element in it) to show up on Google Maps.
If I download a self-contained KML with all the data it does show up on
Google Maps, but obviously that's not reasonable for layers with a lot of
data.
Another interesting thing I noticed is that other KML files with
NetworkLinks do work in Google Maps (e.g.,
http://cleanwater.goshen.edu/kml/ccwp.kml), so this does not seem to be
something stupid I did on the Google Maps side (this KML I mentioned has a
<Link> tag inside the <NetworkLink>, as opposed to a <Url> tag that comes
in the one generated by GeoServer)
So my questions are:
- Should this be working and I am indeed doing something stupid on the
Google Maps side?
Never tried, never tested, the target of KML generation has always been
Google Earth.. unfortunately nowadays GE just crashes on startup on my
linux system, so I could not check interactively right now, but as far as I
know, the default KML generation mode does no generate a superoverlay, you
should first configure the superoverlay strategy in the layer, and then use
a link like:
http://localhost:8080/geoserver/topp/wms/kml?layers=topp:states&mode=superoverlay
- Is there any GeoServer configuration tweak I can use to get this to
work, or is KML simply not fit for this purpose because Google Maps doesn't
support loading KML features on demand?
No idea
- Is there another solution using GeoServer that could work well for this
situation, using Google Maps?
I cannot think of another one, besides maybe plain WMS using some scale
based styles that show stuff progressively (but it would be different,
getting raster tiles). Or maybe some similar client side arrangement
downloading geojson with a different cql filter depending on the current
scale?
Unsure, I have no experience with google maps client side programming.
- Would this KML idea work well out of the box with other web clients
(OpenLayers, Leaflet, etc)?
Was not tested while developing KML support, so I don't know 
Cheers
Andrea
--
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------