A marker is 3D object at a given lat/lng location. You can choose from built-in meshes such as pins and flags or use your own 3D geometry.
Use EarthInstance.addMarker( properties )
var mymarker = myearth.addMarker( {
location: { lat : 22.5, lng : 20 },
mesh: ["Pin2", "Needle"],
color: "#00FF00"
} );
{ lat: 0, lng: 0 }
The geo location where the marker is placed.
0
Distance to the earth surface.
["Pin", "Needle"]
A marker consists of one or more meshes. The builtin mesh names are:
Pin, Pin2, Pin3, Flag, Flag2, Flag3, Needle, X, Diamond, Marker and Cone.
Example: Builtin Marker Meshes
Example: Custom Marker Meshes
#FF0000
Colors of the meshes (in the order in which they are defined).
1
0
Rotation in degrees.
false
The marker is rotated around the Y axis to point at the defined lat/lng position.
Example: Look at Location
false
Set to true if you add mouse/touch events to this marker. * After initation you can set hotspot to false to disable mouse/touch events temporarily.
Example: Click Events
0.5
1.5
Use EarthInstance.showHotspots to see the hotspot area.
1
0.0 - 1.0
false (if opacity not set)
Set to true if you want to use opacity.
true
true
If set to false the marker points up and is not aligned with the earth surface.
occluded is true if the marker is on the backside of the earth.
0.1
0.0 - 1.0
Only if light: "sun". Shininess of the surface.
false
Only if light: "sun" or light: "simple". Unsmoothed shading of the surface.
true
Cast a shadow on the earth or other markers. See shadows.
false
Receive shadows of the earth or other markers. See shadows.
Reference to the EarthInstance.
Example: Animatable Properties
Stops all animations of this object. To stop a specific animation use AnimationInstance.stop()
Removes the marker permanently.
The events is triggered when you click or touch the hotspot area.
mymarker.addEventListener( 'click', function( ) {
this.earth.location = this.location;
console.log( this );
} );
mymarker.addEventListener( 'click', function( ) {
alert( this.myCustomProperty );
} );
The events are triggered when you move the mouse over the hotspot area.
mymarker.addEventListener( 'mouseover', function( ) {
myoverlay.location = this.location;
myoverlay.content = this.myMarkerTitle;
myoverlay.visible = true;
} );
mymarker.addEventListener( 'mouseout', function( ) {
myoverlay.visible = false;
} );
The event is triggered when the marker is added and when the occluded property changes.
Example: Occlusion