PDA

View Full Version : Adding overlays on a map



ramotswa
29 Nov 2010, 6:41 AM
Hey guys,

So the getting started guide very nicely says to go and read about the google maps api to use with sensa touch. What I am wondering is how you would go about adding an overlay to a map in sensa touch?
Looking at the google example it would be



var ctaLayer = new google.maps.KmlLayer('http://gmaps-samples.googlecode.com/svn/trunk/ggeoxml/cta.kml');
ctaLayer.setMap(map);

However, using that won't work as "map" is the panel, rather than the google map.. and using something like "google.maps.Map" won't work either as it wouldn't know which map it's referring to.

Any ideas would be most welcome.

Thanks,

Ramo

ramotswa
29 Nov 2010, 6:50 AM
Ok got a step further..

referred to it as map.map (original!)..

but nothing is coming up.. should this work?


Ext.setup({

onReady: function () {
var myLatlng = new google.maps.LatLng(41.875696, -87.624207);
var map = new Ext.Map({
title: 'Map',
getLocation: true,
mapOptions: {
zoom: 12,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
});

var ctaLayer = new google.maps.KmlLayer('../../met/kml/oplayout.kml');
ctaLayer.setMap( map.map);

new Ext.Panel({
fullscreen: true,
html: "main container",
dockedItems: [south, north, map, west, {
xtype: "container",
height: "55"
}]
});