0

At one point I was able to load custom placemark icons into the Google Earth JavaScript API; however, sometime in the last few months, something has changed.

If I add a marker in the google domain it seems to work... but if I use another icon from the internet it fails.

I followed the instructions from the documentation and I still get nothing.

// Define a custom icon.
var icon = earth.createIcon('');
icon.setHref('http://www.jcsda.noaa.gov/images/arrowDown.jpg');
var style = earth.createStyle(''); //create a new style
style.getIconStyle().setIcon(icon); //apply the icon to the style
placemark.setStyleSelector(style); //apply the style to the placemark

For the sake of clarity I have made a fiddle illustrating the problem.

Any thoughts on where I am going wrong?

UPDATE

Last night when I made the fiddle the icon failed to load... this morning when I checked it has spontaneously started working for some icons.

Interestingly, it's still not working in my application.

I am using an Apache web server and I have some security in place (using .htaccess file) requiring a username and password... this has been active for months, but could it now be prevent Google Earth from accessing the icons even though I am logged in?

4

1 に答える 1

0

あなたのページは https ですか? ブラウザの混合コンテンツ http/https の問題である可能性があります

于 2013-06-10T21:18:15.483 に答える