Hey Eric, Turns out that out model is quite different. Since you seem experienced with google maps, I'll tell you what I'm doing, just to see if it makes any sense.
I learned hibernate and thought it was really convenient to add an annotation to my class declaration and have a table created for it, without me having to write the SQL by hand. There is this wonderful topology suite called JTS - Java Topology Suite ( http://jts-topo-suite.sf.net ) which can do spatial operations on Geometries (polygons and polylines with operations like within, intersects, union and buffer for example). Some guys that use hibernate thought it was great as well, and created an extension called Hibernate Spatial ( http://www.hibernatespatial.org/ ) which added support to hibernate persist JTS' Geometry class into Oracle/PostgreSQL (PostGIS)/MySQL. As I use PostgreSQL + PostGIS (because I could easily import a shapefile I had, with data from my city, Rio de Janeiro, Brazil), I figured I could easily manipulate this data on the pure java side with HibernateSpatial and it seemed the right thing to do (at the time). As I had written a piece of app with the Mapitz API I thought to myself "wouldn't it be great to use JTS + HibernateSpatial with Google Maps + GWT?". If I could make it work I could make an application to query my data with google maps. So I tackled one problem at a time. First, JTS + GWT: turns out that JTS uses classes not emulated by GWT's JRE. But GWT has a <super-source /> tag which you can use to override a class implementation. So I pasted the classes (mainly geometries) I needed in a directory which I included in my <super- source /> tag on my module.gwt.xml and stripped off the use of the function calls which resulted with the use of non-emulated JRE classes (actually, I realize as I'm writing this, that this is a bad idea, I should emulate the classes not yet emulated. If I duplicate JTS' code, I won't survive their API changes - it is really good to be able to "talk" to someone about the stuff you are doing!) Second, GWT + (JTS + HibernateSpatial): so turns out that using hibernate on GWT is not so straight forward, but thanks to Bruno Marchesson's Hibernate4GWT library, it turns out that it is actually possible. So I had to patch up his library and create support for HibernateSpatial. Third, (Google Maps + GWT) + (JTS + HibernateSpatial): As I could use JTS geometries on GWT, all I had to do was to write a JTSGWTConverter which would convert the following gemetries: JTS Point -> Maps LatLng JTS LineString -> Maps Polyline JTS Polygon -> Maps Polygon (more in the future if needed) So I'm able to load and persist data in PostGIS and display it on Google Maps. On your bounds cache, you tackled one use case. I tackled my use case where I tend to pan a lot and zoom out rarely, just doing good old browsing around... Good that you pointed it out. HibernateSpatial (+ PostGIS) gives me functions of loading points within a Polygon A and not within Polygon B which I was thinking to use on the cache to not send duplicate Geometries to my client. Also I would control the bounds already sent to the client as a List of Polygons (LatLngBounds) per Zoom level, where a higher zoom value, would update the lower zoom values bounds list - I tell you this because I see you used max zoom and min zoom. I am not sure about performance on the geometry manipulation, I will be testing this on the client soon. If any of this doesn't make any sense, please tell me so. There can be nothing worse than someone seeing you are heading in the wrong direction and saying nothing (-: I'm writing this for fun in my own spare time, so progress is rather slow, but I'm happy to brainstorm with you, if you think that I can help with anything Regards, Alexandre Pretyman On Sep 1, 3:04 pm, Eric B <[EMAIL PROTECTED]> wrote: > Thanks. I hadn't thought of using a Polygon to capture past maps > bounds. I think the idea has merit, but I use a SQL query on the > server side to get new locations for the Overlay Manager. I do > something like "where lat/lng in ( current bounds ) and lat/lng not in > ( old bounds #1 ) and lat/lng not in ( old bounds #2 ) ..." (psuedo > code obviously). > > I'm not sure how I would efficiently communicate the union'd polygon > to the database. I know MySQL has spatial capabilities, but I've > never used them. If I could send the polygon's vertices to MySQL and > have it do all the processing, that'd really be great. > > It turns out that the way people view maps, the BoundsCachingListener > is really efficient in regards to storing the past map bounds. > Because people tend to find a location, then zoom out, and then back > in on another location, when they zoom out, the past map bounds that > are entirely contained within the new map bounds are removed from the > cache. > > I welcome any help on this, > Eric --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
