Reputation: 6316
How can I add CSS class/style to Google Earth balloon which has been created from createFeatureBalloon()
method?
I already tried this code by adding .setAttribute("class", "myStyle");
to balloon object but it seems it is not working here. Is there any way to do this in Google Earth?
function showBalloon() {
var balloon = ge.createFeatureBalloon('div');
balloon.setFeature(placemark);
balloon.setAttribute("class", "myStyle");
balloon.setMaxWidth(600);
ge.setBalloon(balloon);
}
Upvotes: 0
Views: 553
Reputation: 383
You should create a ballon with:
var balloon = ge.createHtmlStringBalloon('');
Then you create a variable with the html code and then use:
balloon.setContentString(html);
You can view https://developers.google.com/earth/documentation/balloons?hl=in
Upvotes: 0