Hi, There is simple test file. It is display message from google api about error key(which applied to referer ip address) when compiled with wt2.1.5. and stops rendering when compiled with 2.2.0. Was tested with firefox3 and IE7. For display google map it is needed right key from google site. Regars, Alex
// GoogleTest.cpp : Defines the entry point for the console application.
//
#include <Wt\WApplication>
#include <Wt\WContainerWidget>
#include <Wt\WLineEdit>
#include <Wt\WPushButton>
#include <Wt\WSignal>
#include <Wt\WJavaScript>
using namespace Wt;
class WGoogleMap : public WContainerWidget
{
public:
WGoogleMap(WContainerWidget *parent = 0)
:WContainerWidget(parent)
{
resize(500,500);
initGoogleMap();
WPushButton *javaButton = new
WPushButton(WString(L"google"),this);
javaButton->clicked.connect(java);
}
private:
void initGoogleMap(void){
WApplication *app = WApplication::instance();
if(app->require("http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAgBzpNwSLvOetYbqEWwSC_hT8LHg9WAhLzS4848EU6vZ384zBExT7j7gwv7Uj4gh1CqzZeYCdq8xfpQ")){
java.setJavaScript("function initialize() { \
if
(GBrowserIsCompatible()) { \
var map
= new GMap2(document.getElementById(\"" + id() + "\")); \
map.setCenter(new GLatLng(47.4419, 31.1419), 13); \
} \
} ");
}
}
JSlot java;
};
class WGoogleTest : public WApplication
{
public:
WGoogleTest(const WEnvironment& env)
: WApplication(env)
{
setTitle(WString("GoogleTest"));
// application title
WGoogleMap *pWGoogleMap = new WGoogleMap(root());
}
//************************
//* functions
//************************
private:
WLineEdit *nameEdit_;
};
WApplication *createApplication(const WEnvironment& env)
{
return new WGoogleTest(env);
}
int main(int argc, char **argv)
{
return WRun(argc, argv, &createApplication);
}
GoogleTest.rar
Description: application/rar
------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
