POST
|
Hello, I can now successfully draw route between two points. Next step is I want to turn-by-turn navigate to that position within my application with voice command. How can I do that?
... View more
05-06-2014
09:29 AM
|
0
|
0
|
2378
|
POST
|
Hi Dan, Thanks for the suggestion. I will follow this.
... View more
05-06-2014
09:25 AM
|
0
|
0
|
894
|
POST
|
Hi Dan, Thanks for the reply. The issue is solved now. I have accepted the answer.
... View more
04-30-2014
01:29 PM
|
0
|
0
|
112
|
POST
|
Hi Dano, That point was just an example. I tried to get lat long for many such points and I don't get a correct value. I'm not sure what mistake I'm doing. The LatLong for the graphic added to the map : 44.881105, -93.203288 The X,Y value after execution the following code: -10375343.000000, 5602823.500000 Point temp = (Point)graphic.getGeometry();
... View more
04-30-2014
12:20 PM
|
0
|
0
|
924
|
POST
|
Hi Shelly, The X and Y value which I get from the marker graphics is
x = -1.0401366E7
y = 5617207.0
and when this data is converted into map points using this line:
final SpatialReference wm = SpatialReference.create(102100);
final SpatialReference egs = SpatialReference.create(4326);
...
...
...
Point loc = mapView.toMapPoint(x, y);
Point p = (Point) GeometryEngine.project(loc, wm,
egs); p.getX() = -139.79025608070413 p.getY() = 24.634571644245387
... View more
04-30-2014
10:44 AM
|
0
|
0
|
924
|
POST
|
I'm getting some values and those values doesn't seem to be right. That's why I'm getting error. Am I doing any thing wrong in getting the lat/lon values?
... View more
04-29-2014
06:03 AM
|
0
|
0
|
924
|
POST
|
Hi Shelly, Thanks for the reply! I tried this line of code and
calculateDirection((float)((Point)graphic.getGeometry()).getX(),(float)((Point)graphic.getGeometry()).getY());
calculateDirection(float x, float y){
final Point loc = mapView.toMapPoint(x, y);
Thread t = new Thread() {
@Override
public void run() {
try {
// Start building up routing parameters
RouteParameters rp = mRouteTask
.retrieveDefaultRouteTaskParameters();
NAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();
// Convert point to EGS (decimal degrees)
Point p = (Point) GeometryEngine.project(loc, wm,
egs);
// Create the stop points (start at our location, go
// to pressed location)
StopGraphic point1 = new StopGraphic(mLocation);
StopGraphic point2 = new StopGraphic(p);
rfaf.setFeatures(new Graphic[] { point1, point2 });
rfaf.setCompressedRequest(true);
rp.setStops(rfaf);
// Set the routing service output SR to our mapView
// service's SR
rp.setOutSpatialReference(wm);
// Solve the route and use the results to update UI
// when received
mResults = mRouteTask.solve(rp);
mHandler.post(mUpdateResults);
} catch (Exception e) {
mException = e;
mHandler.post(mUpdateResults);
}
}
};
// Start the operation
t.start();
}
And got this error. com.esri.core.io.EsriServiceException:Unable to complete operation. Location "Location 2" in "Stops" is unlocated. Need atleast 2 valid stops. "Stops" does not contain valid input for any route. Sometimes I dont get any response back and it loads infinitely.
... View more
04-25-2014
06:22 AM
|
0
|
0
|
924
|
POST
|
I'm adding marker to my map using the following code: mvHelper.addMarkerGraphic(Double.parseDouble(friendData.getLatitude()), Double.parseDouble(friendData.getLongitude()), friendData.getFriendName(), friendData.getStatus(), null, icon, false, 0); This is my listener: mvHelper.setOnGraphicClickListener(new OnGraphicClickListener() { @Override public void onGraphicClick(Graphic graphic) { Log.d("MVHELPER GRAPHIC LISTENER TAG",graphic.toString()); } }); I'm trying to get the lat long position of the clicked marker. But the listener doesn't provide it. How can I get the position?
... View more
04-24-2014
01:38 PM
|
0
|
10
|
6256
|
POST
|
@eric906 I was able to fix the error myself. My exception stack showed this. 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.reflect.InvocationTargetException 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.reflect.Constructor.constructNative(Native Method) 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 06-26 16:36:15.678: E/AndroidRuntime(2672): at android.view.LayoutInflater.createView(LayoutInflater.java:587) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 22 more 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.ExceptionInInitializerError 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapView.a(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapView.<init>(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 25 more 06-26 16:36:15.678: E/AndroidRuntime(2672): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load runtimecore_java: findLibrary returned null 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.Runtime.loadLibrary(Runtime.java:365) 06-26 16:36:15.678: E/AndroidRuntime(2672): at java.lang.System.loadLibrary(System.java:535) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.core.internal.util.e$1.initialize(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.io.a.a(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): at com.esri.android.map.MapSurface.<clinit>(Unknown Source) 06-26 16:36:15.678: E/AndroidRuntime(2672): ... 27 more I was able to solve this by creating a jni folder in my app module and adding the .so files along with the folders into it and adding the following lines to my build.gradle file: tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> pkgTask.jniFolders = new HashSet<File>() pkgTask.jniFolders.add(new File(buildDir, 'native-libs')) } android { packagingOptions { exclude 'META-INF/LGPL2.1' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } }
... View more
04-24-2014
07:02 AM
|
0
|
0
|
894
|
POST
|
Hi, I'm using android studio for my application development. I tried adding MapView in my XML file and initialize it in my fragment class but I'm getting following exception. My project structure: [ATTACH=CONFIG]33227[/ATTACH] My build.gradle: apply plugin: 'android' android { compileSdkVersion 19 buildToolsVersion '19.0.1' defaultConfig { minSdkVersion 10 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:appcompat-v7:19.1.0' compile 'com.android.support:support-v4:19.1.0' compile 'com.google.android.gms:play-services:+' compile fileTree(dir: 'libs', include: ['*.jar']) compile files('libs/arcgis-android-api.jar') compile files('libs/jackson-core-lgpl-1.9.5.jar') compile files('libs/jackson-mapper-lgpl-1.9.5.jar') compile files('libs/jcifs-1.3.17.jar') } android { packagingOptions { exclude 'META-INF/LGPL2.1' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } } My XML file: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <!-- MapView layout and initial extent --> <com.esri.android.map.MapView android:id="@+id/my_custom_map" android:layout_width="fill_parent" android:layout_height="fill_parent" initExtent = "-1.3296373526814876E7 3930962.41823043 -1.2807176545789773E7 4201243.7502468005"> </com.esri.android.map.MapView> </FrameLayout> My Frgament class: @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater,container,savedInstanceState); // Inflate the layout for this fragment Log.d("ON CREATEVIEW()","ON CREATEVIEW()"); meterGroupMapFragmentView = inflater.inflate(R.layout.map_arcgis, container, false); mapView = (MapView)meterGroupMapFragmentView.findViewById(R.id.my_custom_map); mapView.addLayer(new ArcGISTiledMapServiceLayer("" + "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer")); return meterGroupMapFragmentView; }
... View more
04-21-2014
07:50 AM
|
2
|
5
|
5047
|
Title | Kudos | Posted |
---|---|---|
2 | 04-21-2014 07:50 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|