POST
|
usaLayer is type TiledLayer(cached layer) ArcGISTiledLayer usaLayer = new ArcGISTiledLayer(getResources().getString(R.string.mycustom_base_map)); map.getBasemap().getBaseLayers().add(usaLayer); http://115.79.20.1:6080/arcgis/rest/services/DUAN_NN/Maplocal_NN/MapServer(mycustom_base_map)
... View more
07-23-2019
07:43 PM
|
0
|
0
|
1042
|
POST
|
the usaLayer and usaLayerCached in the same the spatial reference as the wkString defined. All layer in app same spatial reference
... View more
07-22-2019
11:39 PM
|
0
|
0
|
1042
|
POST
|
i want to display the location on the map, i new map with: ArcGISTiledLayer usaLayer = new ArcGISTiledLayer(getResources().getString(R.string.map_layer)); map = new ArcGISMap(SpatialReference.create(getResources().getString(R.string.wkid))); and show location but location deviate about 300m from the current location; my code map = new ArcGISMap(SpatialReference.create(getResources().getString(R.string.wkString)));
// Viewpoint viewPoint1 = new Viewpoint(new Point(433214.603,1211184.161, map.getSpatialReference()), 1000000);
// map.setInitialViewpoint(viewPoint1);
// map = new ArcGISMap();
map.getBasemap().getBaseLayers().add(usaLayer);
mMapView = (MapView) findViewById(R.id.mapView);
BackgroundGrid backgroundGrid = new BackgroundGrid(Color.WHITE,Color.WHITE,0,2);
mMapView.setBackgroundGrid(backgroundGrid);
mMapView.setMap(map);
Viewpoint viewPoint = new Viewpoint(new Point(433214.603,1211184.161, map.getSpatialReference()), 1000000);
mMapView.setViewpoint(viewPoint);
// map.setInitialViewpoint(view);
mMapView.setAttributionTextVisible(false); mLocationDisplay = mMapView.getLocationDisplay();
mLocationDisplay.addDataSourceStatusChangedListener(new LocationDisplay.DataSourceStatusChangedListener() {
@Override
public void onStatusChanged(LocationDisplay.DataSourceStatusChangedEvent dataSourceStatusChangedEvent) {
// If LocationDisplay started OK, then continue.
if (dataSourceStatusChangedEvent.isStarted())
return;
// No error is reported, then continue.
if (dataSourceStatusChangedEvent.getError() == null)
return;
// If an error is found, handle the failure to start.
// Check permissions to see if failure may be due to lack of permissions.
boolean permissionCheck1 = ContextCompat.checkSelfPermission(MainActivity.this, reqPermissions[0]) ==
PackageManager.PERMISSION_GRANTED;
boolean permissionCheck2 = ContextCompat.checkSelfPermission(MainActivity.this, reqPermissions[1]) ==
PackageManager.PERMISSION_GRANTED;
if (!(permissionCheck1 && permissionCheck2)) {
// If permissions are not already granted, request permission from the user.
ActivityCompat.requestPermissions(MainActivity.this, reqPermissions, requestCode);
} else {
// Report other unknown failure types to the user - for example, location services may not
// be enabled on the device.
String message = String.format("Error in DataSourceStatusChangedListener: %s", dataSourceStatusChangedEvent
.getSource().getLocationDataSource().getError().getMessage());
Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();
// Update UI to reflect that the location display did not actually start
mSpinner.setSelection(0, true);
}
}
});
// Populate the list for the Location display options for the spinner's Adapter
ArrayList<ItemData> list = new ArrayList<>();
list.add(new ItemData("", R.mipmap.locationdisplaydisabled));
list.add(new ItemData("", R.mipmap.locationdisplayon));
list.add(new ItemData("", R.mipmap.locationdisplayrecenter));
list.add(new ItemData("", R.mipmap.locationdisplaynavigation));
list.add(new ItemData("", R.mipmap.locationdisplayheading));
SpinnerAdapter adapter = new SpinnerAdapter(this, R.layout.spinner_layout, R.id.txt, list);
mSpinner.setAdapter(adapter);
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
// Stop Location Display
if (mLocationDisplay.isStarted())
mLocationDisplay.stop();
break;
case 1:
// Start Location Display
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
case 2:
// Re-Center MapView on Location
// AutoPanMode - Default: In this mode, the MapView attempts to keep the location symbol on-screen by
// re-centering the location symbol when the symbol moves outside a "wander extent". The location symbol
// may move freely within the wander extent, but as soon as the symbol exits the wander extent, the MapView
// re-centers the map on the symbol.
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.RECENTER);
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
case 3:
// Start Navigation Mode
// This mode is best suited for in-vehicle navigation.
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.NAVIGATION);
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
case 4:
// Start Compass Mode
// This mode is better suited for waypoint navigation when the user is walking.
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.COMPASS_NAVIGATION);
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
}); Everything works fine, but the location service is not correct
... View more
07-21-2019
07:30 PM
|
0
|
0
|
415
|
POST
|
i use sdk runtime arcgis for android to show current location on the map but location incorrect; below is my custom SpatialReference Spatial Reference: PROJCS["VN-2000",GEOGCS["GCS_VN_2000",DATUM["D_VN_2000",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",107.75],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]],VERTCS["Hon_Dau_1992",VDATUM["Hon_Dau_1992"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]
... View more
07-21-2019
09:07 AM
|
0
|
2
|
548
|
POST
|
HOw to select top feature from featurelayer with out max record arcgis server
... View more
07-21-2019
08:51 AM
|
0
|
1
|
376
|
POST
|
location services deviate about 300m from the current location; my custom Spatial Reference (wkString) Spatial Reference: PROJCS["VN-2000",GEOGCS["GCS_VN_2000",DATUM["D_VN_2000",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",107.75],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]],VERTCS["Hon_Dau_1992",VDATUM["Hon_Dau_1992"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]] below my code: map = new ArcGISMap(SpatialReference.create(getResources().getString(R.string.wkString)));
// Viewpoint viewPoint1 = new Viewpoint(new Point(433214.603,1211184.161, map.getSpatialReference()), 1000000);
// map.setInitialViewpoint(viewPoint1);
// map = new ArcGISMap();
map.getBasemap().getBaseLayers().add(usaLayer);
map.getBasemap().getBaseLayers().add(usaLayerCached);
//map.getBasemap().getBaseLayers().add(FeatureLayerVungCay);
mMapView = (MapView) findViewById(R.id.mapView);
BackgroundGrid backgroundGrid = new BackgroundGrid(Color.WHITE,Color.WHITE,0,2);
mMapView.setBackgroundGrid(backgroundGrid);
mMapView.setMap(map);
Viewpoint viewPoint = new Viewpoint(new Point(433214.603,1211184.161, map.getSpatialReference()), 1000000);
mMapView.setViewpoint(viewPoint);
// map.setInitialViewpoint(view);
mMapView.setAttributionTextVisible(false); mLocationDisplay = mMapView.getLocationDisplay();
mLocationDisplay.addDataSourceStatusChangedListener(new LocationDisplay.DataSourceStatusChangedListener() {
@Override
public void onStatusChanged(LocationDisplay.DataSourceStatusChangedEvent dataSourceStatusChangedEvent) {
// If LocationDisplay started OK, then continue.
if (dataSourceStatusChangedEvent.isStarted())
return;
// No error is reported, then continue.
if (dataSourceStatusChangedEvent.getError() == null)
return;
// If an error is found, handle the failure to start.
// Check permissions to see if failure may be due to lack of permissions.
boolean permissionCheck1 = ContextCompat.checkSelfPermission(MainActivity.this, reqPermissions[0]) ==
PackageManager.PERMISSION_GRANTED;
boolean permissionCheck2 = ContextCompat.checkSelfPermission(MainActivity.this, reqPermissions[1]) ==
PackageManager.PERMISSION_GRANTED;
if (!(permissionCheck1 && permissionCheck2)) {
// If permissions are not already granted, request permission from the user.
ActivityCompat.requestPermissions(MainActivity.this, reqPermissions, requestCode);
} else {
// Report other unknown failure types to the user - for example, location services may not
// be enabled on the device.
String message = String.format("Error in DataSourceStatusChangedListener: %s", dataSourceStatusChangedEvent
.getSource().getLocationDataSource().getError().getMessage());
Toast.makeText(MainActivity.this, message, Toast.LENGTH_LONG).show();
// Update UI to reflect that the location display did not actually start
mSpinner.setSelection(0, true);
}
}
});
// Populate the list for the Location display options for the spinner's Adapter
ArrayList<ItemData> list = new ArrayList<>();
list.add(new ItemData("", R.mipmap.locationdisplaydisabled));
list.add(new ItemData("", R.mipmap.locationdisplayon));
list.add(new ItemData("", R.mipmap.locationdisplayrecenter));
list.add(new ItemData("", R.mipmap.locationdisplaynavigation));
list.add(new ItemData("", R.mipmap.locationdisplayheading));
SpinnerAdapter adapter = new SpinnerAdapter(this, R.layout.spinner_layout, R.id.txt, list);
mSpinner.setAdapter(adapter);
mSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
switch (position) {
case 0:
// Stop Location Display
if (mLocationDisplay.isStarted())
mLocationDisplay.stop();
break;
case 1:
// Start Location Display
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
case 2:
// Re-Center MapView on Location
// AutoPanMode - Default: In this mode, the MapView attempts to keep the location symbol on-screen by
// re-centering the location symbol when the symbol moves outside a "wander extent". The location symbol
// may move freely within the wander extent, but as soon as the symbol exits the wander extent, the MapView
// re-centers the map on the symbol.
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.RECENTER);
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
case 3:
// Start Navigation Mode
// This mode is best suited for in-vehicle navigation.
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.NAVIGATION);
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
case 4:
// Start Compass Mode
// This mode is better suited for waypoint navigation when the user is walking.
mLocationDisplay.setAutoPanMode(LocationDisplay.AutoPanMode.COMPASS_NAVIGATION);
if (!mLocationDisplay.isStarted())
mLocationDisplay.startAsync();
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
... View more
07-18-2019
09:45 PM
|
0
|
5
|
1324
|
POST
|
if i use "query.setMaxFeatures(20);" my code show error Cannot call this method in this context if i not use "query.setMaxFeatures(20);" working. how to select top record by use setMaxFeatures method final QueryParameters query = new QueryParameters(); //
query.setWhereClause("upper(name) LIKE '%" + strSearch.toUpperCase() + "%'");
query.setReturnGeometry(false);
query.setMaxFeatures(20);
final ListenableFuture<FeatureQueryResult> future = ServiceFeature.queryFeaturesAsync(query, ServiceFeatureTable.QueryFeatureFields.LOAD_ALL);
public void run() {
try {
final FeatureQueryResult result = future.get();
Iterator<Feature> iterator = result.iterator();
int count = 0;
...
...
... View more
07-15-2019
09:20 AM
|
0
|
0
|
278
|
POST
|
1.How to registry event or listener add feature Layer to map complete 2. How to listener Basemap change
... View more
06-04-2019
10:03 AM
|
0
|
2
|
689
|
POST
|
How to create Map (display map) base on ArcGISTiledLayer arcgis android 100.0.0 by Tile map cached services from Arcgis server
... View more
01-16-2017
08:25 PM
|
0
|
1
|
1756
|
POST
|
About speed, ArcGISDynamicMapServiceLayer speed faster or run faster tiled servicesArcGISDynamic? MapServiceLayer has not load faster tiled services?
... View more
12-22-2016
06:14 PM
|
0
|
1
|
718
|
POST
|
Thank repply, you have any approach for this problem? can use Dynamic map service overlay Esri basemap World_Topo_Map (MapServer)?
... View more
12-22-2016
05:44 PM
|
0
|
3
|
718
|
POST
|
i use Esri basemap World_Topo_Map (MapServer) then overlay my Tiled Map Services; my Tiled Map Services display incorrect place. How To overlays two Tiled Map Services with Different Spatial References in ArcGIS API for JavaScript?( two Services cached scale as same; Different Spatial References)?? my code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no"> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://js.arcgis.com/3.18/esri/css/esri.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <link href="css/main.css" rel="stylesheet" /> <script src="https://js.arcgis.com/3.18/"></script> <script type="text/javascript"> var map; require([ "esri/map", "dojo/ready", "esri/SpatialReference", "esri/layers/ArcGISTiledMapServiceLayer", "dojo/dom", "dojo/on", "dojo/_base/array", "dojo/parser", "dojo/domReady!" ], function ( Map, ready, SpatialReference, ArcGISTiledMapServiceLayer, dom, on, array, parser ) { ready(function () { parser.parse(); }); var spatialReference2 = new SpatialReference({ "wkt": 'PROJCS["VN-2000",GEOGCS["GCS_VN_2000",DATUM["D_VN_2000",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",107.75],PARAMETER["Scale_Factor",0.9999],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]],VERTCS["Hon_Dau_1992",VDATUM["Hon_Dau_1992"],PARAMETER["Vertical_Shift",0.0],PARAMETER["Direction",1.0],UNIT["Meter",1.0]]' }); map = new Map("mapDiv", { spatialReference: spatialReference2 }); var pathGooglemap = "http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer"; var tiled = new ArcGISTiledMapServiceLayer("http://stnmt.dongnai.gov.vn:8080/atlasadaptor/rest/services/Bandochuyende/NEN_CAOSU_vn_g/MapServer"); map.addLayers([tiled]); map.on("Click", function (evt) { GooglemapLayer = new ArcGISTiledMapServiceLayer(pathGooglemap, { id: "idchuyende" }); map.addLayer(GooglemapLayer, 0); }); }); </script> <title></title> </head> <body class="claro"> <div id="conttain"> <div id="divmap_data"> <div id="mapDiv"> </div> </div> </div> </body> </html>
... View more
12-21-2016
08:32 PM
|
0
|
5
|
1924
|
POST
|
yes i will try what you instructions, and notify the results to you! thank you
... View more
12-15-2016
06:44 PM
|
0
|
0
|
237
|
POST
|
Means that change projection of the data congtrinh_du to 102100? other way without changing projection of the data? because I have used congtrinh_du in another application, and I do not want to copy the data into a new congtrinh_du that new congtrinh_du. have any of the approaches? thank!
... View more
12-15-2016
05:58 PM
|
0
|
2
|
1413
|
Title | Kudos | Posted |
---|---|---|
1 | 11-15-2015 05:58 AM |
Online Status |
Offline
|
Date Last Visited |
04-08-2022
05:06 AM
|