Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Enclosed in this article you will also find a full implemented widget and the respective source code to download.
User Satisfaction and Data Traffic
- reduce application startup time;
- minimize data traffic;
- improve the user experience when it comes to mobile data traffic expenses;
- improve the user experience inducing flow;
Hide and Show div elements
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="basic.css" type="text/css">
<META NAME="Generator" CONTENT="Nokia WRT plug-in for Aptana Studio 2.0.0" />
// Hide the button div
var div_load = document.getElementById("div-load");
div_load.style.display = "none";
// Show the map div
var div_map = document.getElementById("div-map");
div_map.style.display = "block";
// Dynamic load the script
The loadScript function is called to dynamic load the Google Maps API. The callback function at the end of the url is used to asynchronous create a GMap2 object.
var script = document.createElement("script");
script.src = "http://maps.google.com/maps?file=api&v=2.x&key=YOUR-API-KEY&async=2&callback=loadMap";
Event callback used to create a Map
The function loadMap is executed after the load of Google Maps API. It creates a GMap2 object at the "div-map".
// create the map object
var map = new GMap2(document.getElementById("div-map"));
// set the center of the map
map.setCenter(new GLatLng(43.7430739, 7.4307509), 6);
// add a marker at the center
Media:RuntimeLibraries.wgz (from www.felipeandrade.org/exemplos/RuntimeLibraries.wgz)
- (1) Mihaly Csikszentmihalyi,Finding Flow:The Psychology of Engagement with Everyday Life(New York:Basic Books, 1997),29.
- (2) Mihaly Csikszentmihalyi,Beyond Boredom and Anxiety:Experiencing Flow in Work and Play (1975;reprint,with a Preface by Mihaly Csikszentmihalyi,San Francisco:Jossey-Bass,2000),36.
--Felipe Andrade 17:03, 14 June 2009 (EEST)