I tried this, but It didn't work

function load() {

 if (GBrowserIsCompatible()) {
  var map = new GMap2(document.getElementById("map"));
  map.setMapType(G_HYBRID_MAP)
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());
  map.setCenter(new GLatLng(12.0, -70.0), 4);
 }
}
var boundaries;
var oldmap;

function toggle(checked) {

 if(checked== true) {

// ground overlay
boundaries = new GLatLngBounds(new GLatLng(-15.0,-100), new
GLatLng(15.0,-60.0));
nivel='p.png';
omap = new GGroundOverlay("../descargas/" + nivel, boundaries);
map.addOverlay(omap);

 }

 else {
  map.removeOverlay(oldmap);
 }
}

<input name="box" id="towns" onclick="toggle(checked)"
type="checkbox"></p>



On 11 oct, 17:38, estatio <[EMAIL PROTECTED]> wrote:
> Thanks for your answer.
>
> The truth is that I don't have idea how to do it. I just want to
> toggle on and off the following overlay with a checkbox.
>
> var boundaries = new GLatLngBounds(new GLatLng(-15.0,-100),
> newGLatLng(15.0,-60.0));
> omap = new GGroundOverlay("../ds/a.png", boundaries);
> map.addOverlay(omap);
>
> On 11 oct, 15:44, Rossko <[EMAIL PROTECTED]> wrote:
>
> > It's often pretty useless posting a code snippet.  For one example -> ...
> > > alert(obj.cheked)
>
> > > if(obj.checked){
>
> > Is that a typo in your code or in your posting??
> > For another example, we've no idea what objects and functions of yours
> > may or may not be in global scope.
> > Best all round to give a link to your example page.
>
> > > The other question is about getting the latitude and longitude of one
> > > point in the map. I just want to click the map and assign the latitude
> > > to variable and the longitude to another variable. I've tried using
> > > the function .getLatLng() without success.
>
> > Try searching this group.  A recent post 
> > -http://groups.google.com/group/Google-Maps-API/browse_thread/thread/6...
>
> > 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to