Cesium编程-绘制图形
通过Entity绘制图形添加一个立方体
var viewer = new Cesium.Viewer("cesiumContainer");var redBox = viewer.entities.add({ name:' box with outline', position: Cesium.Cartesian3.fromDegrees(112.92,28.20,3000.0), box : { dimensions : new Cesium.Cartesian3(400.0, 300.0, 500.0), material : Cesium.Color.RED.withAlpha(0.5), outline : true, outlineColor : Cesium.Color.BLACK } ...
Arcgis相关知识
AGS相关知识:
添加一个 GraphicsOverlay
点
let graphicsOverlay = AGSGraphicsOverlay() mapView.graphicsOverlays.add(graphicsOverlay) let ref:AGSSpatialReference = .wgs84() let pointGraphic: AGSGraphic = { //Create a point geometry let point = AGSPoint(x: 111.677914, y: 40.838096, spatialReference: ref) //Create point symbol with outline // style: 中心点的样式 let symbol = AGSSimpleMarkerSymbol(style: .diamond, col ...
Arcgis-Search for an address
Link: https://developers.arcgis.com/labs/ios/search-for-an-address/
let geocoder:AGSLocatorTask = AGSLocatorTask(url: URL(string: "https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer")!)
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { guard let searchText = searchBar.text, !searchText.isEmpty else { print("Nothing to search") return } geocoder.geocode(withSearchText: searchText) & ...
Arcgis offline map(Swift)
加载离线地图:
private let mobileMapPackage = AGSMobileMapPackage(name: "offline-maps-package") private func setupMap() { mobileMapPackage.load { [weak self](error) in guard let self = self else {return} if let error = error { print("Error loading the mobile map package: \(error.localizedDescription)") return }else if let map = self.mobileMapPackage.maps.first{ ...
Arcgis for Android 100.10.0(一):开发环境配置
(一) 在Project的build.gradle文件中中进行配置:allprojects { repositories { google() jcenter() // Add the following ArcGIS repository maven { url 'https://esri.bintray.com/arcgis' } }}
(二) 在Module的build.gradle中添加依赖:// Add ArcGIS Runtime SDK for Android dependencyimplementation 'com.esri.arcgisruntime:arcgis-android:100.10.0'
(三) 在Module的builde.gradle的android中添加配置:android { compileSdkVersion 30 ...
Arcgis Runtime API for Android 100.13 (一)环境配置
环境配置1.低版本的Gradle,在 build.gradle 的repositories 里配置
高版本的Gradle,在settings.gradle里的dependencyResolutionManagement里配置
repositories { google() mavenCentral() maven { url 'https://esri.jfrog.io/artifactory/arcgis' } }
2.在Module的build.gradle里配置
implementation 'com.esri.arcgisruntime:arcgis-android:100.13.1'
3.在Module build.gradle里配置Java8
android { ... compileOptions { sourceCompatibility 1.8 targetCompatibil ...
Arcgis Runtime API for Android 100.13 (二)基本地图
上篇介绍了环境配置,现在来展示一个基本二维地图
1、在AndroidManifest.xml中添加网络权限和OpenGL 2.0支持
<uses-permission android:name="android.permission.INTERNET"/><uses-feature android:glEsVersion="0x00020000" android:required="true" />
2、布局文件
<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width=& ...
iOS Touch ID使用
Swift:
import LocalAuthentication
var context = LAContext() @IBAction func loginBtnClick(_ sender: Any) { context = LAContext() context.localizedCancelTitle = "Cancel"; // context.localizedFallbackTitle = ""; var error:NSError? if context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error){ let reason = "Run App" context.evaluatePolicy(.deviceOwnerAuthentication, ...
iOS单例宏定义
定义:
// @interface#define singleton_interface(className) \+ (className *)shared##className;// @implementation#define singleton_implementation(className) \static className *_instance; \+ (id)allocWithZone:(NSZone *)zone \{ \ static dispatch_once_t onceToken; \ dispatch_once(&onceToken, ^{ \ _instance = [super allocWithZone:zone]; \ }); \ return _instance; \} \+ (className *)shared##className \{ \ static dispatch_once_t onceToken; \ dispatch_o ...
Kotlin函数
函数类型作为返回类型fun main() { println(show("Demo")) val lambdaFunction = showMethod("Jack") //注意lambdaFunction 这里的类型为(String,Int) -> String println(lambdaFunction("Carl",20))}//普通函数fun show(name:String): String { return "name is $name"}//返回类型为函数fun showMethod(name: String): (String,Int) -> String { println("name is $name") return { name: String, age: Int -> "名字是:$name,年纪是$age" ...