Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Small and medium teams
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
bigdataMS
imobile_for_javascript
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
imobile_for_javascript
/
NativeModule
/
Geometry.js
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
42 lines (40 loc) · 1.67 KB
master
Breadcrumbs
imobile_for_javascript
/
NativeModule
/
Geometry.js
Copy path
Top
File metadata and controls
Code
Blame
42 lines (40 loc) · 1.67 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import
{
NativeModules
}
from
'react-native'
;
let
G
=
NativeModules
.
JSGeometry
;
import
Point2D
from
'./Point2D.js'
;
/**
*
@class
Geometry
*
@description
所有具体几何类型(GeoPoint, GeoLine, GeoRegion 等)的基类,提供了基本的几何类型的方法。
该类用于表示地理实体的空间特征,并提供相关的处理方法。根据地理实体的空间特征不同,分别用点(GeoPoint),线(GeoLine),面(GeoRegion)等加以描述。当该类的子类的对象实例被 dispose 后,再调用该类的方法会抛出 ObjectDisposedException。
用户自己创建的 Geometry 对象,例如 GeoPoint、GeoLine、GeoRegion 等对象,在执行完系列操作后,需要对其进行释放。
*/
export
default
class
Geometry
{
/**
* 返回几何对象的内点。
*
@memberOf
Geometry
*
@returns
{
Promise.<Point2D>
}
*/
async
getInnerPoint
(
)
{
try
{
var
{
point2DId
}
=
await
G
.
getInnerPoint
(
this
.
_SMGeometryId
)
;
var
point2D
=
new
Point2D
(
)
;
point2D
.
_SMPoint2DId
=
point2DId
;
return
point2D
;
}
catch
(
e
)
{
console
.
error
(
e
)
;
}
}
/**
* 设置几何对象的风格。几何风格是用于定义几何对象在显示时的符号、线型、填充模式等信息。
*
@memberOf
Geometry
*
@param
{
object
} geoStyle - 用来设置几何对象风格的 GeoStyle 对象。
*
@returns
{
Promise.<void>
}
*/
async
setStyle
(
geoStyle
)
{
try
{
var
id
=
this
.
_SMGeometryId
||
this
.
_SMGeoPointId
;
await
G
.
setStyle
(
id
,
geoStyle
.
_SMGeoStyleId
)
;
}
catch
(
e
)
{
console
.
error
(
e
)
;
}
}
}
You can’t perform that action at this time.