PDA

View Full Version : Google StreetView



garaving
17 Aug 2011, 1:37 PM
streetview how do I put inside a Tab?
I have code like this


<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Google Map and Street View</title>


<!--<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAV38kHM1UsodB4XVQ2bHfphT2yXp_ZAY8_ufC3CFXhHIE1NvwkxTy7iqOkF6pCBIwNtQ1HWUhZG3Nww" type="text/javascript"></script>
-->
<script src="http://maps.googleapis.com/maps/api/js?sensor=false" type="text/javascript"></script>
<script type="text/javascript">

function initialize() {
var fenway = new google.maps.LatLng(42.345573,-71.098326);


var mapOptions = {
center: fenway,
zoom: 14,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(
document.getElementById("map_canvas"), mapOptions);
var panoramaOptions = {
position: fenway,
pov: {
heading: 34,
pitch: 10,
zoom: 1
}
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById("pano"),panoramaOptions);
map.setStreetView(panorama);
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width: 400px; height: 300px"></div>
<div id="pano" style="position:absolute; left:410px; top: 8px; width: 400px; height: 300px;"></div>
</body>
</html>


What should I do?

gab_gar
18 Aug 2011, 5:33 AM
I too am interested
some advice

Surykat
19 Aug 2011, 1:05 AM
First: Why this subject is in that category?

Second: What does it have in common with sencha touch?

In sencha You have a datatype to render a map. In code it looks like:


var map = new Ext.Panel({
layout: 'fit',
items: [{
xtype: 'map'
}]
});

And you can put it wherever you want it. TabPanel?



var map = new Ext.Panel({
tittle: 'Map tab',
layout: 'fit',
items: [{
xtype: 'map'
}]
});


new Ext.TabPanel({
layout:'fit', fullscreen: true,
scroll:'vertical',
items: [{
title: 'First tab',
xtype: 'panel'
}, map]
});

garaving
19 Aug 2011, 1:12 AM
thanks for the answer
I explained evil
I would like to start the map in StreetView mode, so i thought of converting the code shown above for the SenchaTouch

Surykat
19 Aug 2011, 1:22 AM
Look at this doc: http://dev.sencha.com/deploy/touch/docs/source/Map.html#cfg-Ext.Map-mapOptions
You could combine Google Maps options with xtype map in Sencha. No problem :)

garaving
19 Aug 2011, 1:27 AM
thanks
i try over the weekend and then place the example generated