Thanks Ross,

the solution didn't work. I'll explain what I think needs to done
again. the following link describes the differences between Maplets
and API: 
http://code.google.com/apis/maps/documentation/mapplets/guide.html#Differences

Firstly, it reads:
“Communication between a Mapplet and the Google Maps site is
asynchronous. As a result, some methods behave differently than their
standard Google Maps API counterparts. For the most part, operations
that modify the map (e.g. setCenter(), addOverlay()) are identical to
the operations in the Maps API. However, operations that obtain a
return value from the map require a callback function. In Mapplets, we
appended Async onto the names of all Maps API methods that are
affected by this, and their return values are instead passed as an
argument to the callback function.
For example, in the Maps API, one would write:
var zoom = map.getZoom();
alert("Current zoom level is " + zoom);
alert("This happens after you see the zoom level message");

Whereas in a Mapplet, this has to be written as:
map.getZoomAsync(function(zoom) {
  alert("Current zoom level is " + zoom);
});
alert("This might happen before or after you see the zoom level
message");
“

So I believe I would need to change this part:
        map.getBoundsZoomLevelAsync(bounds, function(level) {
                map.setCenter(bounds.getCenter());
                map.setZoom(level);
                _gel("content").innerHTML = displayHTML;
                _gel("status").innerHTML = "Done loading concert
data";
        });


I have changed it to this:

map.setZoom(map.getBoundsZoomLevel(bounds));
map.setCenter(bounds.getCenter());

                _gel("content").innerHTML = displayHTML;
                _gel("status").innerHTML = "Done loading concert
data";


Secondly, it reads:

"Mapplets are served from gmodules.com which is located on a server
run by Google. The browser's security model does not allow Javascript
on gmodules.com to request data from any other domain, so you cannot
use GDownloadUrl (nor GXml) inside your Mapplet to fetch data from
your server.
Instead, the gadgets API provides the following calls which will fetch
content via a proxy running on gmodules.com:
•       _IG_FetchContent(url, callback) -- Returns the content at url as
text. Use this function to fetch HTML or plain text content.
•       _IG_FetchXmlContent(url, callback) -- Returns and operates on the
XML content at url as a DOM object. Use this function to fetch XML
content which must be parsed.
These methods behave differently than GDownloadUrl and GXml in the
following ways:..."


So I believe I will need to change this piece of code:
_IG_FetchXmlContent(url, _IG_Callback(handleFetchContent, city));
from the loadData function.

Any help here? Thanks, Yasir

On Apr 2, 11:30 pm, Rossko <[email protected]> wrote:
> > I've uplaoded the html file with the javascript, that I have worked on
> > so far:www.iborough.co.uk/tourfilter.html
>
> It might be easier to get a 'straight' API book but nevertheless ...
>
> I guess the stumbling block at the moment is getting the 'city' select
> drop-down to actually do something to the map.
>
> Firebug tells me the loadData() function is getting called when the
> select box is changed, but it fails "_gel is not defined".
>
> Looking at the rest of the code, I'd guess _gel is supposed to point
> to a <div> or something to display status information.
> If we actually look in the HTML, there's a
>     <span id="status"> ...
> that looks like the right place.
>
> Untested, but if you try
>     var _gel ;
> in global context, and then in your loadMap() function point it at the
> <span>
>     _gel =  = document.getElementById('status');
> you should now have a target for your code to work on.
>
> You'll probably want to get a browser javascript debugger while
> working on this project.
>
> 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