Hi Raul,
here a few bits of code that might give you inspiration ...
this would even work with the playground if the playground had shorter urls ...
(google does not like long urls)
var win = new qx.ui.window.Window("Map").set({
layout: new qx.ui.layout.Grow(),
width: 400, height: 400});
this.getRoot().add(win);
win.open();
function loadScript(callback) {
if (!google){
var script = document.createElement("script");
script.type = "text/javascript";
script.src =
"http://maps.google.com/maps/api/js?sensor=false&callback="+callback;
document.body.appendChild(script);
}
else {
window[callback]();
}
}
window.showMap = function (){
var mapWidget = new qx.ui.core.Widget();
mapWidget.addListenerOnce('appear', function() {
var loc = {
lat: 47.59,
lng: -95.5,
name: 'test'
};
var el = mapWidget.getContentElement().getDomElement();
var myOptions = {
zoom : 16,
mapTypeId : google.maps.MapTypeId.SATELLITE
};
var map = new google.maps.Map(el, myOptions);
mapWidget.addListener('resize', function() {
qx.html.Element.flush();
google.maps.event.trigger(map, 'resize');
});
var bounds = new google.maps.LatLngBounds();
var latLong = new google.maps.LatLng(loc.lat, loc.lng);
bounds.extend(latLong);
new google.maps.Marker({
map : map,
position : latLong,
title : String(loc.name)
});
map.setCenter(latLong);
});
win.add(mapWidget);
};
loadScript('showMap');
--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [email protected] ++41 62 775 9902 / sb: -9900
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel