本文整理汇总了Java中com.esri.arcgisruntime.tasks.geocode.GeocodeParameters类的典型用法代码示例。如果您正苦于以下问题:Java GeocodeParameters类的具体用法?Java GeocodeParameters怎么用?Java GeocodeParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeocodeParameters类属于com.esri.arcgisruntime.tasks.geocode包,在下文中一共展示了GeocodeParameters类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: findPlacesNearby
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
/**
* Use the location service to geocode places of interest
* based on the map's visible area extent.
*/
@Override public final void findPlacesNearby() {
mMapView.showProgressIndicator("Finding nearby places...");
final Point g = mMapView.getMapView().getVisibleArea().getExtent().getCenter();
if ( g !=null ){
final GeocodeParameters parameters = new GeocodeParameters();
parameters.setMaxResults(MAX_RESULT_COUNT);
parameters.setPreferredSearchLocation(g);
mLocationService.getPlacesFromService(parameters, new PlacesServiceApi.PlacesServiceCallback() {
@Override public void onLoaded(final Object places) {
final List<Place> data = (List) places;
// Create graphics for displaying locations in map
mMapView.showNearbyPlaces(data);
}
});
}
}
开发者ID:Esri,项目名称:nearby-android,代码行数:23,代码来源:MapPresenter.java
示例2: getGeocode
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
@FXML
public void getGeocode() {
// get the address from the search box
String address = searchBox.getText();
// create geocode parameters
GeocodeParameters geocodeParameters = new GeocodeParameters();
geocodeParameters.getResultAttributeNames().add("*");
geocodeParameters.setMaxResults(1);
geocodeParameters.setOutputSpatialReference(sceneView.getSpatialReference());
// get the geocode for the address
geocodeResult = locatorTask.geocodeAsync(address, geocodeParameters);
geocodeResult.addDoneListener(this::markFire);
}
开发者ID:Esri,项目名称:arcgis-runtime-demo-java,代码行数:17,代码来源:MonitorController.java
示例3: getPlacesFromService
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
@Override public void getPlacesFromService(@NonNull final GeocodeParameters parameters,@NonNull final PlacesServiceCallback callback) {
final String searchText = "";
provisionOutputAttributes(parameters);
provisionCategories(parameters);
final ListenableFuture<List<GeocodeResult>> results = sLocatorTask
.geocodeAsync(searchText, parameters);
Log.i(TAG,"Geocode search started...");
results.addDoneListener(new GeocodeProcessor(results, callback));
}
开发者ID:Esri,项目名称:nearby-android,代码行数:10,代码来源:LocationService.java
示例4: provisionCategories
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
private static void provisionCategories(@NonNull final GeocodeParameters parameters){
final List<String> categories = parameters.getCategories();
categories.add("Food");
categories.add("Hotel");
categories.add("Pizza");
categories.add("Coffee Shop");
categories.add("Bar or Pub");
}
开发者ID:Esri,项目名称:nearby-android,代码行数:9,代码来源:LocationService.java
示例5: getPlacesNearby
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
@Override public final void getPlacesNearby() {
if (mDeviceLocation != null) {
GeocodeParameters parameters = new GeocodeParameters();
parameters.setMaxResults(MAX_RESULT_COUNT);
parameters.setPreferredSearchLocation(mDeviceLocation);
mLocationService.getPlacesFromService(parameters, new PlacesServiceApi.PlacesServiceCallback() {
@Override public void onLoaded(Object places) {
List<Place> data = (List) places;
// Show list of places
setPlacesNearby(data);
}
});
}
}
开发者ID:Esri,项目名称:nearby-android,代码行数:16,代码来源:PlacesPresenter.java
示例6: search
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
/**
* Searches for places near the chosen location when the "search" button is clicked.
*/
@FXML
private void search() {
String placeQuery = placeBox.getEditor().getText();
String locationQuery = locationBox.getEditor().getText();
if (placeQuery != null && locationQuery != null && !"".equals(placeQuery) && !"".equals(locationQuery)) {
GeocodeParameters geocodeParameters = new GeocodeParameters();
geocodeParameters.getResultAttributeNames().add("*"); // return all attributes
geocodeParameters.setOutputSpatialReference(mapView.getSpatialReference());
// run the locatorTask geocode task
ListenableFuture<List<GeocodeResult>> results = locatorTask.geocodeAsync(locationQuery, geocodeParameters);
results.addDoneListener(() -> {
try {
List<GeocodeResult> points = results.get();
if (points.size() > 0) {
// create a search area envelope around the location
Point p = points.get(0).getDisplayLocation();
Envelope preferredSearchArea = new Envelope(p.getX() - 10000, p.getY() - 10000, p.getX() + 10000, p.getY
() + 10000, p.getSpatialReference());
// set the geocode parameters search area to the envelope
geocodeParameters.setSearchArea(preferredSearchArea);
// zoom to the envelope
mapView.setViewpointAsync(new Viewpoint(preferredSearchArea));
// perform the geocode operation
ListenableFuture<List<GeocodeResult>> geocodeTask = locatorTask.geocodeAsync(placeQuery,
geocodeParameters);
// add a listener to display the results when loaded
geocodeTask.addDoneListener(new ResultsLoadedListener(geocodeTask));
}
} catch (Exception e) {
e.printStackTrace();
}
});
}
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:40,代码来源:FindPlaceController.java
示例7: searchByCurrentViewpoint
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
/**
* Searches for places within the current map extent when the "redo search in this area" button is clicked.
*/
@FXML
private void searchByCurrentViewpoint() {
String placeQuery = placeBox.getEditor().getText();
GeocodeParameters geocodeParameters = new GeocodeParameters();
geocodeParameters.getResultAttributeNames().add("*"); // return all attributes
geocodeParameters.setOutputSpatialReference(mapView.getSpatialReference());
geocodeParameters.setSearchArea(mapView.getCurrentViewpoint(Viewpoint.Type.BOUNDING_GEOMETRY).getTargetGeometry());
//perform the geocode operation
ListenableFuture<List<GeocodeResult>> geocodeTask = locatorTask.geocodeAsync(placeQuery, geocodeParameters);
// add a listener to display the results when loaded
geocodeTask.addDoneListener(new ResultsLoadedListener(geocodeTask));
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:18,代码来源:FindPlaceController.java
示例8: DataManager
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
public DataManager(){
mGeocodeParameters = new GeocodeParameters();
mGeocodeParameters.getResultAttributeNames().add("*");
mGeocodeParameters.setMaxResults(1);
}
开发者ID:Esri,项目名称:mapbook-android,代码行数:6,代码来源:DataManager.java
示例9: provisionOutputAttributes
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
private static void provisionOutputAttributes(@NonNull final GeocodeParameters parameters){
final List<String> outputAttributes = parameters.getResultAttributeNames();
outputAttributes.clear();
outputAttributes.add("*");
}
开发者ID:Esri,项目名称:nearby-android,代码行数:6,代码来源:LocationService.java
示例10: setUpOfflineMapGeocoding
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
private void setUpOfflineMapGeocoding() {
// create a basemap from a local tile package
TileCache tileCache = new TileCache(extern + getResources().getString(R.string.sandiego_tpk));
tiledLayer = new ArcGISTiledLayer(tileCache);
Basemap basemap = new Basemap(tiledLayer);
// create ArcGISMap with imagery basemap
mMap = new ArcGISMap(basemap);
mMapView.setMap(mMap);
mMap.addDoneLoadingListener(new Runnable() {
@Override
public void run() {
Point p = new Point(-117.162040, 32.718260, SpatialReference.create(4326));
Viewpoint vp = new Viewpoint(p, 10000);
mMapView.setViewpointAsync(vp, 3);
}
});
// add a graphics overlay
graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.setSelectionColor(Color.CYAN);
mMapView.getGraphicsOverlays().add(graphicsOverlay);
mGeocodeParameters = new GeocodeParameters();
mGeocodeParameters.getResultAttributeNames().add("*");
mGeocodeParameters.setMaxResults(1);
//[DocRef: Name=Picture Marker Symbol Drawable-android, Category=Fundamentals, Topic=Symbols and Renderers]
//Create a picture marker symbol from an app resource
BitmapDrawable startDrawable = (BitmapDrawable) ContextCompat.getDrawable(this, R.drawable.pin);
mPinSourceSymbol = new PictureMarkerSymbol(startDrawable);
mPinSourceSymbol.setHeight(90);
mPinSourceSymbol.setWidth(20);
mPinSourceSymbol.loadAsync();
mPinSourceSymbol.setLeaderOffsetY(45);
mPinSourceSymbol.setOffsetY(-48);
mReverseGeocodeParameters = new ReverseGeocodeParameters();
mReverseGeocodeParameters.getResultAttributeNames().add("*");
mReverseGeocodeParameters.setOutputSpatialReference(mMap.getSpatialReference());
mReverseGeocodeParameters.setMaxResults(1);
mLocatorTask = new LocatorTask(extern + getResources().getString(R.string.sandiego_loc));
mCalloutContent = new TextView(getApplicationContext());
mCalloutContent.setTextColor(Color.BLACK);
mCalloutContent.setTextIsSelectable(true);
}
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:53,代码来源:MainActivity.java
示例11: setUpOfflineMapGeocoding
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
/**
* Sets up a LocatorTask from the loaded mobile map package, and graphics to show results from running the task.
* Shows a message to user if Locator task is not found.
*/
private void setUpOfflineMapGeocoding() {
if (mMobileMapPackage.getLocatorTask() == null) {
Snackbar.make(mMapView, "Current mobile map package has no LocatorTask", Snackbar.LENGTH_SHORT).show();
return;
}
// Get LocatorTask from loaded MobileMapPackage and listen for loading events
mLocatorTask = mMobileMapPackage.getLocatorTask();
mLocatorTask.addDoneLoadingListener(new Runnable() {
@Override
public void run() {
if (mLocatorTask.getLoadStatus() != LoadStatus.LOADED) {
Snackbar.make(mMapView, String.format(getString(R.string.object_not_loaded), "LocatorTask"),
Snackbar.LENGTH_SHORT).show();
}
}
});
mLocatorTask.loadAsync();
// Add a graphics overlay that will be used for geocoding results
graphicsOverlay = new GraphicsOverlay();
graphicsOverlay.setSelectionColor(0xFF00FFFF);
mMapView.getGraphicsOverlays().add(graphicsOverlay);
// Define the parameters that will be used by the locator task
mGeocodeParameters = new GeocodeParameters();
mGeocodeParameters.getResultAttributeNames().add("*");
mGeocodeParameters.setMaxResults(10); //1);
mGeocodeParameters.setOutputSpatialReference(mMapView.getSpatialReference());
//Create picture marker symbols from app resources for geocode results
BitmapDrawable addressDrawable = (BitmapDrawable) ContextCompat.getDrawable(this, R.drawable.pin_blank_orange);
mFromAddressSymbol = new PictureMarkerSymbol(addressDrawable);
mFromAddressSymbol.setHeight(64);
mFromAddressSymbol.setWidth(64);
mFromAddressSymbol.loadAsync();
mFromAddressSymbol.setLeaderOffsetY(32);
mFromAddressSymbol.setOffsetY(32);
BitmapDrawable hydrantDrawable = (BitmapDrawable) ContextCompat.getDrawable(this, R.drawable.pin_circle_blue_d);
mToAddressSymbol = new PictureMarkerSymbol(hydrantDrawable);
mToAddressSymbol.setHeight(64);
mToAddressSymbol.setWidth(64);
mToAddressSymbol.loadAsync();
mToAddressSymbol.setLeaderOffsetY(32);
mToAddressSymbol.setOffsetY(32);
}
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:53,代码来源:GeocodeRouteActivity.java
示例12: getPlacesFromService
import com.esri.arcgisruntime.tasks.geocode.GeocodeParameters; //导入依赖的package包/类
void getPlacesFromService(@NonNull GeocodeParameters parameters, @NonNull PlacesServiceCallback callback);
开发者ID:Esri,项目名称:nearby-android,代码行数:2,代码来源:PlacesServiceApi.java
注:本文中的com.esri.arcgisruntime.tasks.geocode.GeocodeParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论