- Visit a model's details page.
- Click on the Include button. A snippet of HTML appears.
- Click on the Image or 3D View radio button. These buttons determine whether the model will appear as a 2D image (Image) or 3D model (3D View) on your web page. These radio buttons actually alter the
etype(embed type) variable in the HTML snippet (im= Image andsw= 3D swivel view). An example HTML snippet, with theetypeset toimfollows:<iframe src='http://sketchup.google.com/3dwarehouse/mini?mid=5368e94d006f71f1ae682533f3f1d4dd&etyp=im&width=400&height=300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='400' height='300'></iframe> - Cut and paste the HTML into your web page's HTML to display the model.
You must change the height and width parameters in both places they appear in the HTML snippet to change height and width. An example HTML snippet with width and height changed to 600 and 700 follows:
<iframe src='http://sketchup.google.com/3dwarehouse/mini?mid=5368e94d006f71f1ae682533f3f1d4dd&etyp=im&width=600&height=700' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='600' height='700'></iframe>
The Google Earth plug-in allows you to display Google Earth within the context of your web site. You can also display a model within the Google Earth plug-in by changing the etyp to ge. An example HTML snippet for displaying a model in Google Earth plug-in follows:
<iframe src='http://sketchup.google.com/3dwarehouse/mini?mid=b04d228d93a01e07b84c98d39901e6ed&etyp=ge&width=600&height=700' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='600' height='700'></iframe>
Checking for the Google Earth plug-in
Your web site should also check to ensure the Google Earth plug-in is installed. Following is a snippet of javascript used to determine if the Google Earth plug-in is installed (this javascript would come before the HTML snippet to display the model):
<html>
<body>
<script type="text/javascript" src="http://www.google.com/jsapi?key=ABCDEFG"> </script>
<script type="text/javascript">google.load("earth", "1");</script>
<iframe id='3dwh-embed' src='' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' width='400' height='300'></iframe>
<script>
var url = 'http://sketchup.google.com/3dwarehouse/mini?mid=b04d228d93a01e07b84c98d39901e6ed&width=400&height=300'
url += google.earth.isInstalled() ? '&etyp=ge' : '&etyp=sw';
document.getElementById('3dwh-embed').src = url;
</script>
</body>
</html>
