Actually, what I want to achieve is basically replace loading the xml
data through the database with the php script with another method that
would load the polygons from the kml file. Today, the
marcadoresBairros.js does the following (see the comments):
var bairro_parametro = nome;
var parametro = "carregaBairros.php?nome=";
// this will make the php script load the polygon for a specific
neighborhood
// instead of using the php script to get the data from the database
we want
// to be able to parse a kml file with the same information
GDownloadUrl(parametro + bairro_parametro, function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName
("marker");
for (var i = 0; i < markers.length; i++) {
var bairro = eval(markers[i].getAttribute("bairro"));
if (overlay!=null){map.removeOverlay(overlay);}
overlay = new GPolygon(bairro, "#ff3c00", 2, 0.7,
"#ffdcd1", 0.5 );
var centro = overlay.getBounds().getCenter();
map.panTo(centro);
map.addOverlay(overlay);
}
Thanks!
On 22 jul, 20:37, Grok Lobster <[email protected]> wrote:
> To me, it's not clear what you want to achieve. Do you want a kml file
> that shows all the neighborhoods initially and then when the user
> chooses a particular one, the map zooms there? Your map works quite
> well (FF only) and might be slowed a bit using a kml to display all
> the neighborhoods at once.
>
> On Jul 22, 1:57 pm, Joice <[email protected]> wrote:
>
> > Dear friends, thanks to the help of a lot of good people here, I was
> > able to build a small sample application using the Google Maps API,
> > PHP, PostgreSQL/PostGis and JavaScript. It is hosted atwww.mapzoom.com.br
> > and I have included an English version. I would like very much to hear
> > your comments. It is only tested using Firefox and it is not W3C
> > compliant yet. The source code, however, is there and it is open
> > source, of course.
>
> > If you look at the tarball you will see under the sql folder the
> > bairros.sql file. This loads the polygons for the neighborhoods of the
> > city of Lajeado. The php script carregaBairros.php generates the xml
> > to be used by narcadoresBairros.js which pretty much does the trick
> > when you select a neighborhood at the bottom of the menu on the left.
>
> > Instead of having a sql file, however, we would like to use a kml file
> > directly and still allow the same functionality for the user. For
> > example, we would like to use as the input the
> > filehttp://www.brodtec.com/joice/boston.kml
>
> > Do you have any hint?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---