Does any one has a clue on how to have the Krpano viewer on Google Earth environment? If there is someone interested on helping me developing this, will be appreciated. Let me know your qualifications to come to an arrangement.
Thank you all,
Juan
Does any one has a clue on how to have the Krpano viewer on Google Earth environment? If there is someone interested on helping me developing this, will be appreciated. Let me know your qualifications to come to an arrangement.
Thank you all,
Juan
360cities have managed to do it, and now have their own layer on Google Earth as well. I have not managed to find any information about how this was done, but would be really interested to know.
Pentimo had done this also. 360emerates.com i think.
Peminto's runs within his own site, I have seen that before, we even managed it about a year back for a while on an older plugin with Google maps, but it proved unstable then. Hopefully the newer version will work better. This is not the same as having a layer within Google Earth itself, using kmz files to locate the pins and somehow open up the Krpano viewer.
anyone any ideas about that?
1) Create kmz with pins
2) Give placemark logical names
<Placemark>
<name>loc07hw</name>
<LookAt>
<longitude>6.604122522335477</longitude>
<latitude>53.23377901645496</latitude>
<altitude>0</altitude>
<range>1006.984890987802</range>
<tilt>0</tilt>
<heading>0.01478110113125686</heading>
<altitudeMode>relativeToGround</altitudeMode>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<styleUrl>#msn_marker0</styleUrl>
<Point>
<extrude>1</extrude>
<altitudeMode>absolute</altitudeMode>
<coordinates>6.604347168499247,53.23396062342301,40.00000000000001</coordinates>
</Point>
</Placemark>
Display More
3) Give your hotspots in krpano the same name
4) Use javascript to register an onclick event on placemarkers
5) get the name of tbe onclick placemarker, use that name to get the hotspot onclick action
6) execute that onclick
var ge;
var krpanoObj;
google.load("earth", "1");
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
//get krpano object to allow communication between GE and krpano.
krpanoObj = document.getElementById('krpanoSWFObject');
// add a navigation control
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
// add some layers
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_BUILDINGS, true);
ge.getOptions().setStatusBarVisibility(true);
ge.getOptions().setScaleLegendVisibility(true);
//Initial KMZ
GLoadKMZ('http://yourdomain.com/kmz/placeholders.kml');
function ViewChangeEventHandler () {
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
krpanoObj.set('view.hlookat', lookAt.getHeading());
var tilt = eval(-lookAt.getTilt()) + 90;
if(tilt == 0)
{
tilt = -lookAt.getTilt();
}
krpanoObj.set('view.vlookat', tilt);
krpanoObj.call(trace(0, tilt, krpanoObj.get('view.vlookat')));
}
google.earth.addEventListener(ge.getView(), 'viewchange', ViewChangeEventHandler);
//Click events on the markers
function clickeventHandler(event) {
if (event.getTarget().getType()=='KmlPlacemark') {
var long=event.getTarget().getAbstractView().getLongitude();
var lat=event.getTarget().getAbstractView().getLatitude();
moveToPlacemark(long,lat);
//retry if failed after 3sec
setTimeout (function () { moveInPlacemark(long, lat); }, 3000 );
//open the panorama
var kr_onclick = krpanoObj.get('hotspot['+name+'].onclick');
krpanoObj.call(kr_onclick);
event.preventDefault();
}
}
google.earth.addEventListener(ge.getGlobe(), 'click', clickeventHandler);
google.earth.addEventListener(ge.getGlobe(), 'dblclick', clickeventHandler);
}
Display More
This is based on a view with 2 divs, 1 with GE and 1 with krpano. If you want 1 view with GE, you can use stuff like lightbox/fancybox/thickbox etc to open a popup. You can use the placemarkers name to generate a string with the url to the xml.
So instead of
you could have
Hope that helped
Don’t have an account yet? Register yourself now and be a part of our community!