Initialize the LatLonGrid plugin.
Name | Type | Description |
---|---|---|
viewer |
Viewer | The Cesium viewer object. |
Members
currentExtent : Rectangle
Current Extent To Render
Render the grid.
Flag to control the visibility of the grid labels.
Methods
Convert degrees to DMS.
Name | Type | Description |
---|---|---|
deg |
number | The degrees. |
lat |
boolean | True if it is latitude, false otherwise. |
Returns:
The DMS string.
Clean up the LatLonGrid instance.
This method removes all event listeners, the ResizeObserver, and the labels and polylines
added to the scene by this instance. It also removes the label and polyline collections
from the scene primitives. It should be called before disposing of the LatLonGrid object
to ensure that all resources are released properly and no memory leaks occur.
Draw the grid.
Name | Type | Description |
---|---|---|
extent |
Object | The extent of the grid to draw. |
Get the extent view.
Returns:
The extent view.
Get the grid precision.
Name | Type | Description |
---|---|---|
dDeg |
number | The degrees. |
Returns:
The precision.
/**
Make a label.
Name | Type | Default | Description |
---|---|---|---|
lng |
number | Longitude. | |
lat |
number | Latitude. | |
text |
string | The label text. | |
isLat |
boolean | True if it is a latitude label, false otherwise. | |
color |
string |
white
|
optional The color of the label. Optional, defaults to "white". |
meridians |
boolean |
false
|
optional True if drawing meridians, false otherwise. Optional, defaults to false. |
Remove all polylines
Get the screen center position.
Returns:
The screen center position.