Geofencing

494
1
11-19-2017 01:25 PM
AneeqaAbrar1
New Contributor III

I'm stuck. I'm trying to create geofencing offline. So I am trying get the location on PositionChanged (below) => but for geom I get null. Why? 

Also, how would I create geom for a geodatabase? As I said its offline => code is also below. Geodatabase is working. I just want that if we enter this polygon, the user gets a warning message. Thanks for help in advance!

   onPositionChanged: {

 var newPoint = positionSource.position.coordinate
console.log(newPoint)
var geom = GeometryEngine.project(newPoint, SpatialReference.createWebMercator())
console.log(geom)

//-------------------------------------------------------------------------------------------------------------------------------------------------------//

 FeatureLayer{
id: featureLayer
 featureTable: featureTable.geodatabaseFeatureTablesByTableName["TestFencingHoff"]
 // create the geodatabase
 Geodatabase {
 id: featureTable
  path: AppFramework.resolvedPathUrl(copyLocalData(inputGeofencing, outputGeofencing))
 }
  }
0 Kudos
1 Reply
nakulmanocha
Esri Regular Contributor

If you still working on this. There is a similar question which has been answered here

https://community.esri.com/thread/205748-issue-with-github-offline-geodatabase-example 

0 Kudos