My Google Map Blog

Archive for October 26th, 2015


Drawing arcs with JavaScript

by Timothy Whitehead on Oct.26, 2015, under 3D Models, Argentina, Australia, Brazil, California, Denmark, England, Germany, Google Earth News, Google Earth Tips, Google Sky, Google maps, Hawaii, Indonesia, Ireland, Italy, Japan, Kenya, Mexico, Natural Landmarks, Netherlands, Sightseeing, Street Views, USA

A couple of weeks ago Google updated the Voyager layer, adding a new sub-layer called ‘Animal View’. The layer includes some nice arcs between placemarks. However, there is no automatic way to create these arcs with Google Earth or in KML. We do not know how Google created them, but when we have seen it done in the past (such as in this KML) it was done programmatically.

We thought a utility to create these arcs might be useful.

In order to draw an arc we first needed to work out the location of points along a great circle between two points. We did this with assistance from this website. We have used a simple sine wave and by default make the maximum altitude of the centre of the arc one fourth of the distance between the two points. There is also the option to set the maximum altitude of the arc. We have used altitudes relative to the ground, which has the advantage of making sure the end points start from the ground, but as can be seen in the screen shot above, if there is a significant dip in the ground altitude it is mirrored in the arc as well (notice dips where the arc crosses the river). This effect is not noticeable for larger arcs.

You can include multiple features, such as Placemarks, Polygons or Paths. All Placemarks will be put together and arcs drawn between pairs of consecutive points. Polygons and Paths will have an arc between each consecutive point.

If you don’t like the styling, you can adjust that later in Google Earth or in the KML.


No of segments to divide into:

Altitude method:

Maximum altitude: (metres relative to ground)

Extrude: (shades the area below the arc)

The post Drawing arcs with JavaScript appeared first on Google Earth Blog.

Comments Off : more...


Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...