How to add Google Earth placemarks on website
Hi, Morning to everyone. I had created a new website few days before and wanted to know how can I set up google earth for my website? I don't know how to add placemark on website. Can anyone suggest me to add placemark on my website? I have tried so much but unable to get any solution over it. So, just give me solution. I am waiting for your reply. Try to send it as soon as possible.
Re: How to add Google Earth placemarks on website
Hi, you can directly go to the google site and from there you can get instructions regarding the adding placemark you your website of the google earth. So, it just needed to visit the google earth site and follow the instructions which it provide you. It will give you what you want. Basically I don't know how to do this, but my friend told me that google directly provide you to do by itself. You need to just ask him to do this.
Re: How to add Google Earth placemarks on website
hello friend, I also faced this problem before few days. And I have got solution for it by google. It is providing you code which you need to use. I had used it and got solution, suggesting you to use this.
<html>
<head>
<title>Sample</title>
<script src="http://www.google.com/jsapi?key=ABCDEFG"> </script>
<script type="text/javascript">
var ge;
google.load("earth", "1");
function init() {
google.earth.createInstance('map3d', initCB, failureCB);
}
function initCB(instance) {
ge = instance;
ge.getWindow().setVisibility(true);
}
function failureCB(errorCode) {
}
google.setOnLoadCallback(init);
</script>
</head>
<body>
<div id="map3d" style="height: 400px; width: 600px;"></div>
</body>
</html>
Use it.
Re: How to add Google Earth placemarks on website
Hi, I am also facing same problem as you. I am searching for this from 2 days, but unable to get it. Google says that I have to use the following code:
var ge;
var counter = 0;
google.load("earth", "1");
function init()
{
google.earth.createInstance('map3d', initCallback, failureCallback); addSampleButton('Create a Placemark!', buttonClick);
}
function initCallback(instance)
{
ge = instance; ge.getWindow().setVisibility(true);
ge.getNavigationControl().setVisibility(ge.VISIBILITY_AUTO);
ge.getLayerRoot().enableLayerById(ge.LAYER_BORDERS, true);
ge.getLayerRoot().enableLayerById(ge.LAYER_ROADS, true);
var la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
la.setRange(100000);
ge.getView().setAbstractView(la);
createPlacemark();
document.getElementById('installed-plugin-version').innerHTML =
ge.getPluginVersion().toString();
}
function failureCallback(errorCode)
{
}
function createPlacemark() {var placemark = ge.createPlacemark(''); placemark.setName("placemark" + counter);ge.getFeatures().appendChild(placemark);
var icon = ge.createIcon('');
icon.setHref('http://maps.google.com/mapfiles/kml/paddle/red-circle.png');
var style = ge.createStyle('');
style.getIconStyle().setIcon(icon);
placemark.setStyleSelector(style);
var la = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
var point = ge.createPoint('');
point.setLatitude(la.getLatitude());
point.setLongitude(la.getLongitude());
placemark.setGeometry(point);
counter++;
}
function buttonClick()
{
createPlacemark();
}
It is too much confusing. If you got some simple, please reply to me.