ok, it works perfectly now, here's the complete code that i used:
$_output .= "
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
var geo = new GClientGeocoder();
var search = document.getElementById(\"key\").value;
geo.getLocations(search, function (result)
{
if (result.Status.code == G_GEO_SUCCESS) {
for (var i=0; i<result.Placemark.length; i++) {
var p = result.Placemark[i].Point.coordinates;
var marker = new GMarker(new GLatLng(p[1],p[0]));
GEvent.addListener(marker, \"click\", function()
{marker.openInfoWindowHtml(search);});
map.addOverlay(marker);
}
var p = result.Placemark[0].Point.coordinates;
var N = result.Placemark
[0].ExtendedData.LatLonBox.north;
var S = result.Placemark
[0].ExtendedData.LatLonBox.south;
var E = result.Placemark[0].ExtendedData.LatLonBox.east;
var W = result.Placemark[0].ExtendedData.LatLonBox.west;
var bounds = new GLatLngBounds(new GLatLng(S,W), new
GLatLng(N,E));
var zoom = map.getBoundsZoomLevel(bounds);".
sprintf('map.setCenter(new GLatLng(%s, %s), %s, %s);',
number_format($this->center_lat, 6, ".", ""), number_format($this-
>center_lon, 6, ".", ""),'zoom', $this->map_type)."
}
}
);
";
Thanks for the help!
Kul.
On Aug 20, 2:33 pm, kul <[email protected]> wrote:
> but, there's another issue, the information popup bx, that was working
> before on click on the search result,isn't appearing now, wat can be
> the cause for this?
>
> On Aug 20, 2:09 pm, kul <[email protected]> wrote:
>
> > yes, i've made it work now, Thanks for the help!!!
>
> > On Aug 20, 2:01 pm, Rossko <[email protected]> wrote:
>
> > > >http://www.vondoo.com/vmap/
>
> > > It does seem to work for me and goes todifferentzooms depending on
> > > the results.
>
> > > Have you done a 'view source' on this page yet?
> > > The javascript is a bit jumbled, I think it has copy-paste-chunks--of-
> > > code problems.
>
> > > There's more than one map creation and some odd nesting -
> > > function onLoad() {
> > > if (GBrowserIsCompatible()) {
> > > ....
> > > map = new GMap2(document.getElementById("map"));
> > > ....
> > > if (GBrowserIsCompatible()) {
> > > var map = new GMap(document.getElementById("map"));
>
> > > Note also that a GMap is the old version 1 form and won't behave the
> > > same as a GMap2
> > > You have some functions that seem to extend the methods of GMap - I
> > > don't think you need those at all if you use GMap2 consistently.
>
> > > I'd review all that before you go much further.
>
> > > cheers, Ross K
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---