google-earth-plugin

Adding click event to KMLLayer Placemarks and Markers

耗尽温柔 提交于 2019-12-18 12:29:44
问题 How do i attach an onclick event to Placemarks specified in the KML file. Can event listeners be added to both google maps and google earth plugin? How would I go about this? 回答1: In the Google Earth plugin... google.earth.fetchKml(ge, href, function(kmlObject) {}); google.earth.addEventListener(kmlObject, 'click', function(event) { event.preventDefault(); var kmlPlacemark = event.getTarget(); alert(kmlPlacemark.getName()); }); In Google Maps API var ctaLayer = new google.maps.KmlLayer('http:

Adding click event to KMLLayer Placemarks and Markers

跟風遠走 提交于 2019-12-18 12:29:22
问题 How do i attach an onclick event to Placemarks specified in the KML file. Can event listeners be added to both google maps and google earth plugin? How would I go about this? 回答1: In the Google Earth plugin... google.earth.fetchKml(ge, href, function(kmlObject) {}); google.earth.addEventListener(kmlObject, 'click', function(event) { event.preventDefault(); var kmlPlacemark = event.getTarget(); alert(kmlPlacemark.getName()); }); In Google Maps API var ctaLayer = new google.maps.KmlLayer('http:

Styling Google Earth Plugin borders layer

有些话、适合烂在心里 提交于 2019-12-13 05:11:09
问题 I have my map, in 3d and I want to style it so that only counties with markers have a certain color. I also want to change the boundary color. I am using v3 of the Google Maps Api to load the earth. Is there a way to customize the map (3d) and also change the color of the borders in the in-built layer. Example 3d map 回答1: The borders layer you refer to is simply on or off, there are no methods to style it or alter its behaviour. If you wish to have a custom data layer to show borders then you

lazy / demand load KML in google maps or google earth plugin?

ぃ、小莉子 提交于 2019-12-12 10:09:50
问题 Is it possible to lazy load KML files once a Google Map or Google Earth Plugin instance is started? Maybe there is there a "bounding box" event that I can use to queue needed KML files? Edit => Found an answer: Found this little tid-bit ( http://code.google.com/apis/maps/documentation/javascript/events.html ): Note: If you are trying to detect a change in the viewport, be sure to use the specific bounds_changed event rather than constituent zoom_changed and center_changed events. Because the

How to check for presence of the google earth plugin using JavaScript?

我的梦境 提交于 2019-12-12 05:38:44
问题 How can I determine whether the Google Earth Plugin is installed in the browser using JavaScript? 回答1: You can use the isInstalled method: google.load("earth", "1"); if(google.earth.isInstalled()) { //Installed! } However, note that if the plugin is not installed, the user will be automatically prompted to download it. So this is only really of use if you want to only display certain content to users who already have the plugin. 来源: https://stackoverflow.com/questions/10346751/how-to-check

How to convert lat longs into degree format for Google Earth?

笑着哭i 提交于 2019-12-11 18:54:14
问题 I have lat/long coordinates for a list of ports. The coordinates are in a 2856N 05211E format (totally made those numbers up, btw). I'm trying to figure out how I can convert them to the degree format the Google Earth pluginuses in order to plot them on a map. Is there a parameter in the API that I could use to convert this? Any ideas would be appreciated. 回答1: I'm assuming you can parse the values yourself. If not, then provide the language you wish to use. The conversion is simple, Degrees

Sometimes Initialization of Google Earth Plugin fails in IE10

邮差的信 提交于 2019-12-11 13:55:04
问题 This is my code for the initialization of google earth plugin. Sometimes Initialization of Google Earth Plugin fails in IE10(I have it in compatability mode) IE7 Standards. This error happens only in IE and no other browser. 90% of the time createInstance() method creates the google earth plugin instance and control goes to mygeeEarthPluginInitCb() method but few times mostly after restarting the machine or after few hours of inactivity if I load the page createInstance fails and control goes

Google Earth “ERR_CREATE_PLUGIN”

妖精的绣舞 提交于 2019-12-11 10:20:24
问题 I've come across a weird error. I'm trying to load the Google Earth libraries but when doing so am getting the error "ERR_CREATE_PLUGIN" The following code DOES work: <script src="http://www.google.com/jsapi"></script> <script> google.load("earth", "1"); var ge = null; function init() { google.earth.createInstance("map3d", initCallback, failureCallback); } function initCallback(object) { ge = object; ge.getWindow().setVisibility(true); } function failureCallback(object) { } </script> </head>

Google earth Plugin with (preferable) Java

瘦欲@ 提交于 2019-12-11 09:29:33
问题 I wish to build an application that utilize google-earth-plugin with Java (preferable) My goa, in a nutshell, is to use the plugin with the 3D images and to allow endusers to navigate to areas that I defined in advance and add some other features. My understanding is that GE API has deprecated and developers should use the GE plugin. If so, what is the preferable language to build a GE applications. I'm comfortable with Java (on eclipse); but I couldn't find any '101 tutorial' that explains

Google Earth API - drawing lines that curve?

让人想犯罪 __ 提交于 2019-12-11 08:17:03
问题 I've been playing with the google earth API. I thought it would be neat to draw some lines between places from a relative 3D viewpoint. I've searched through the GE documentation and searched on google for answers but didn't find anything that led me down the correct path, so I thought I'd post some code and perhaps get some insight. The following code plots two places and then draws a line between those places. Unfortunately the line that gets drawn splices the earth. Is there a method to