POST
|
I just add successful a tilesmapserviceslayer and a feature layer into activity. However, when i do this in fragment, it can't work. Here is my code: package com.niit.giangnguyen.tree_manager; import android.app.Fragment; import android.graphics.Color; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.esri.android.map.MapView; import com.esri.android.map.ags.ArcGISFeatureLayer; import com.esri.android.map.ags.ArcGISTiledMapServiceLayer; import com.esri.core.geometry.Envelope; public class HomeFragment extends Fragment { public MapView mv = null; public HomeFragment(){} @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_home, container, false); Envelope env = new Envelope(105.50485954224524, 21.04870508156068, 105.75256390997109, 21.09248760188878); mv = (MapView)rootView.findViewById(R.id.map); mv.addLayer(new ArcGISTiledMapServiceLayer( this.getResources().getString(R.string.basemap_url))); mv.setMapBackground(Color.WHITE, Color.MAGENTA, 0, 0); mv.addLayer( new ArcGISFeatureLayer( "http://172.20.10.6/hanoi/rest/services/Hanoi/Cay/FeatureServer/0", ArcGISFeatureLayer.MODE.SNAPSHOT)); return mv; } } And here is my layout <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <com.esri.android.map.MapView android:id="@+id/map" android:layout_width="fill_parent" android:layout_height="fill_parent" mapoptions.center="34.056215, -117.195668" mapoptions.ZoomLevel="16"> <com.esri.android.map.ags.ArcGISFeatureLayer Url="http://172.20.10.6/hanoi/rest/services/Hanoi/Cay/FeatureServer/0" mode="SNAPSHOT" /> </com.esri.android.map.MapView> Help me to solve this problem please. thanks!
... View more
07-03-2015
04:53 AM
|
0
|
1
|
3011
|
POST
|
I want to make a project which only use a city map. So, how can i drop this area from googlemap and use it to creat a service in ArcGis sever? My project on Android. Help me please!
... View more
06-22-2015
10:23 AM
|
1
|
1
|
4804
|
Title | Kudos | Posted |
---|---|---|
1 | 06-22-2015 10:23 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|