So I started playing with the GoogleMaps widget.
But I can't seem to get it running.
Here I what I do :
WGoogleMap::WGoogleMap(WContainerWidget *parent) :
WContainerWidget(parent)
{
// if there is no google api key configured, use the one for
http://localhost:8080/
const string localhost_key =
"ABQIAAAAWqrN5o4-ISwj0Up_depYvhTwM0brOpm-All5BF6PoaKBxRWWERS-S9gPtCri-B6BZeXV8KpT4F80DQ";
string googlekey;
if(!
WApplication::instance()->readConfigurationProperty("google_api_key",
googlekey))
googlekey = localhost_key;
// init the google javascript api
const string gmuri = "http://www.google.com/jsapi?key=" + googlekey;
bool bret = WApplication::instance()->require(gmuri,
"GoogleMapsJavaScriptAPI");
// init the google map window
std::ostringstream strm;
strm << "google.load(\"maps\", \"2\",{\"other_params\":
\"sensor=false\"});";
strm << "function initialize()"
<< "{"
// << " var map = new
google.maps.Map2(document.getElementById(\"map\"));"
<< " var map = new
google.maps.Map2(document.getElementById(\"" << id() << "\"));"
<< " map.setCenter(new google.maps.LatLng(47.01887777,
8.651888), 13);"
<< " map.enableScrollWheelZoom();"
<< " map.addControl(new
google.maps.HierarchicalMapTypeControl());"
<< "}"
<< "google.setOnLoadCallback(initialize);"
;
WApplication::instance()->doJavaScript(strm.str(), true);
}
The full code is at:
http://flugbuch2.svn.sourceforge.net/viewvc/flugbuch2/trunk/src/web/stat/Wt/
The browser freezes with something like "Loading GoogleMap data"
If I inspect the dom structure with FireBug, I have the impression, that
the google stuff is in too many places...
With the following html test page, it displays correctly (the google key
is only for localhost):
http://flugbuch2.svn.sourceforge.net/viewvc/flugbuch2/trunk/src/test/GoogleMapsTestPage.html?revision=45&view=markup
any help is appreciated.
Rgds
Richard
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest