Points API

A points object efficiently draws a large amount of small sprites.

Example: Points Properties

Add Points

Use EarthInstance.addPoints( properties )

var mypoints = myearth.addPoints( {
	points: [
		{ location: {lat: 12.5, lng: 18.7}, scale: 1.5, offset: 0.25 },
		{ location: {lat: 19.3, lng: 10.2}, scale: 1.3 },
		{ location: {lat: 14.9, lng: 15.1}, scale: 1.3, opacity: 0.5 }
	],
	color: '#ff0000',
	opacity: 0.75
} );

Points Properties

points (array)

An array of objects with the following properties:

location (lat/lng)

Location of the point.

offset (float)

0.1

Distance to the earth surface.

scale (float)

1

Size of the point.

color

#FFFFFF

The color is multiplied to the image. If you want to tint the image exactly to the specified color, provide a white image or use imageAlphaOnly: true.

opacity (float)

1

0.0 - 1.0

scale (float)

1

This value is multiplied to the scale value of all points.

color

#FFFFFF

This value is multiplied to the color value of all points.

opacity (float)

1

0.0 - 1.0

This value is multiplied to the opacity value of all points.

image (url string)

dataURI of a white circle

Provide a URL to an image from the same domain or use a dataURI.
SVG files are recommended but it is also possible to use PNG, GIF or JPG files.
Tool: Get Image as dataURI

imageAlphaOnly (float)

false

Set to true, to load your image without colors (completely white), so can you can tint it with the color property.

visible (boolean)

true

Advanced:

earth (EarthInstance)

Reference to the EarthInstance.

object3d (THREE.Object3D)

About THREE.js

 
You can add custom properties that are copied over to the PointsInstance.

Points Methods

animate( property, value, animationProperties ) returns AnimationInstance

property
Name of the animatable property (String)
value
Target value
animationProperties
Object of animation properties

Example: Animatable Properties

stopAllAnimations( triggerComplete, jumpToEnd )

triggerComplete
(boolean) default: false | Calls the complete functions
jumpToEnd
(boolean) default: false | Sets the properties immediately to their end values

Stops all animations of this object. To stop a specific animation use AnimationInstance.stop()

remove( )

Remove all points permanently.