POST
|
Hi Alexander Nohe, i wish u have a good day, i still need your precious help in that problem, i wish that you could help me
... View more
08-18-2016
03:15 PM
|
0
|
2
|
1603
|
POST
|
They are working now, it was just some maintenance on our servers 2016-08-15 14:46 GMT+01:00 Alexander Nohe <geonet@esri.com>: GeoNet <https://community.esri.com/?et=watches.email.thread> How to center the map depending on graphics on it ? reply from Alexander Nohe <https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread> in ArcGIS Runtime SDK for Android - View the full discussion <https://community.esri.com/message/628093-re-how-to-center-the-map-depending-on-graphics-on-it?commentID=628093&et=watches.email.thread#comment-628093>
... View more
08-17-2016
12:22 PM
|
0
|
0
|
1603
|
POST
|
Hi Alexander, thnx for your help, I'm using the code below, and i want to center the camera after creating all of the markers and ploygons //------------------ mvHelper = new MapViewHelper(arcMap);
arcMap.setOnStatusChangedListener(new OnStatusChangedListener() {
public void onStatusChanged(Object source, STATUS status) {
if (status == STATUS.INITIALIZED) {
mvHelper.setShowGraphicCallout(true);
createMarker();
createPolygon();
arcMap.setExtent(graphicsLayer.getFullExtent());
}
} }); //----------createMarker()------------// public void createMarker() {
String url = "http://screendydev.cloudapp.net/screendy/files/projects/mytest/res/others/markers.json";
final String resp = StudioUtilities.sendGetRequest(url);
final Drawable icon = ContextCompat.getDrawable(ctx, R.drawable.map_marker);
try {
JSONObject jsonObject = new JSONObject(resp);
JSONArray jsonArray = jsonObject.getJSONArray("markers");
int count = 0;
while (count < jsonArray.length()) {
JSONObject marker = jsonArray.getJSONObject(count);
int loaded = mvHelper.addMarkerGraphic(
Double.parseDouble(marker.getString("latitude")),
Double.parseDouble(marker.getString("longitude")),
/*marker.getString("title"), marker.getString("subtitle"), null, icon, false, 0);*/
marker.getString("title"), marker.getString("subtitle"), null, icon, false, 1);
if (loaded < 0) {
Log.d("TAG", "Marker Graphic not added to MapView");
} else {
graphicsLayer.getGraphic(loaded);
}
count++;
}
} catch (JSONException e) {
e.printStackTrace();
}
} //----------createPolygon------------//
public void createPolygon() {
String url = "http://screendydev.cloudapp.net/screendy/files/projects/mytest/res/others/polygons.json";
final String resp = StudioUtilities.sendGetRequest(url);
try {
JSONObject jsonObject = new JSONObject(resp);
JSONArray jsonArray = jsonObject.getJSONArray("polygons");
for (int i = 0; i < jsonArray.length(); i++) {
JSONObject polygon = jsonArray.getJSONObject(i);
JSONObject borderObject = polygon.getJSONObject("border");
JSONObject startPointObject = polygon.getJSONObject("starting_point");
final JSONArray pointsArray = polygon.getJSONArray("points");
double[][] p = new double[pointsArray.length()][2];
for (int j = 0; j < pointsArray.length(); j++) {
try {
final JSONObject point = pointsArray.getJSONObject(j);
p [0] = Double.parseDouble(point.getString("latitude"));
p [1] = Double.parseDouble(point.getString("longitude"));
} catch (JSONException e) {
e.printStackTrace();
}
}
String title = polygon.getString("title");
String subtitle = polygon.getString("subtitle");
int size = borderObject.getInt("size");
int bgColor = adjustAlpha(Color.parseColor(polygon.getString("background")));
int borderColor = Color.parseColor(borderObject.getString("color"));
mvHelper.addPolygonGraphic(p, title, subtitle, "", bgColor, borderColor, size, 1);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
... View more
08-11-2016
05:35 AM
|
0
|
5
|
1603
|
POST
|
Thx for the feedback, i dont understand what do you mean by mercator projection, but i can tell you that i m placing my coordinates using mvHelper.addMarkerGraphic and mvHelper.addPolygonGraphic Le 5 août 2016 14:25, "Alexander Nohe" <geonet@esri.com> a écrit : GeoNet <https://community.esri.com/?et=watches.email.thread> How to center the map depending on graphics on it ? reply from Alexander Nohe <https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread> in ArcGIS Runtime SDK for Android - View the full discussion <https://community.esri.com/message/626204?et=watches.email.thread#comment-626204>
... View more
08-05-2016
08:32 AM
|
0
|
7
|
1603
|
POST
|
How to center and zoom camera to see all markers and polygons created by mapviewhelper ?
... View more
08-05-2016
03:53 AM
|
0
|
1
|
1312
|
POST
|
It didn't work, it's focus to the center of the map Le 4 août 2016 13:05, "Alexander Nohe" <geonet@esri.com> a écrit : GeoNet <https://community.esri.com/?et=watches.email.thread> How to center the map depending on graphics on it ? reply from Alexander Nohe <https://community.esri.com/people/ANohe-esristaff?et=watches.email.thread> in ArcGIS Runtime SDK for Android - View the full discussion <https://community.esri.com/message/625776?et=watches.email.thread#comment-625776>
... View more
08-04-2016
06:55 AM
|
0
|
9
|
1603
|
POST
|
How to center the map depending on graphics on it ? it means that all graphics on map, (markers, plygons and polylines) must be shown
... View more
08-04-2016
04:50 AM
|
0
|
11
|
5264
|
POST
|
Thx a lot, it worked , one more issue, is polygon FillStyle, i won't it solid, cuz it covers the map, is there any suggestion
... View more
08-01-2016
08:19 AM
|
0
|
1
|
874
|
POST
|
^^ , it worked for me, filling the array statically , but what i need is to gather data from the json, if it is possible
... View more
08-01-2016
07:53 AM
|
0
|
0
|
874
|
POST
|
Thnks Alexander, i hope that you could help me to solve this problem, i already tried to fill the p array using this code, but the app crashes : double[][] p = new double[2][pointsArray.length()]; int pointCount = 0; while (pointCount < pointsArray.length()) { try { final JSONObject point = pointsArray.getJSONObject(pointCount); p[0][pointCount] = Double.parseDouble(point.getString("latitude")); p[1][pointCount] = Double.parseDouble(point.getString("longitude")); } catch (JSONException e) { e.printStackTrace(); } pointCount++; }
... View more
08-01-2016
07:50 AM
|
0
|
3
|
874
|
POST
|
No, but i need your help to fill the 2 dimensional array (double[][] p) from the points Array : polygons: [ { title: "t_poly1", subtitle: "subt_poly1", background: "green", border: { color: "darkgray", size: 2, style: "solid" }, points: [ { latitude: "33.6060236", longitude: "-7.630058" }, { latitude: "33.601975", longitude: "-7.632489" }, { latitude: "33.605867", longitude: "-7.635220" }, { latitude: "33.605626", longitude: "-7.632988" } ] ]
... View more
08-01-2016
06:40 AM
|
0
|
2
|
874
|
POST
|
This is my code, but not working, is there any thing wrong !? public void createPolygon() { arcMap.addLayer(graphicsLayer); String url = "http://.../polygons.json"; final String resp = StudioUtilities.sendGetRequest(url); arcMap.setOnStatusChangedListener(new OnStatusChangedListener() { private static final long serialVersionUID = 1L; public void onStatusChanged(Object source, STATUS status) { try { JSONObject jsonObject = new JSONObject(resp); JSONArray jsonArray = jsonObject.getJSONArray("polygons"); int count = 0; while (count < jsonArray.length()) { JSONObject polygon = jsonArray.getJSONObject(count); JSONObject borderObject = polygon.getJSONObject("border"); JSONObject startPointObject = polygon.getJSONObject("starting_point"); final JSONArray pointsArray = polygon.getJSONArray("points"); double[][] p = { { 33.599389, -7.610728 }, { 33.599985, -7.597180 }, { 33.588879, -7.617027 } }; int loaded = mvHelper.addPolygonGraphic(p, "pol_t", "pol_st", "", Color.GREEN, Color.DKGRAY, 2, 0); if (loaded < 0) { Toast.makeText(ctx, "Marker Graphic not added to MapView", Toast.LENGTH_SHORT).show(); } else { Toast.makeText(ctx, "Marker Graphic is added to MapView", Toast.LENGTH_SHORT).show(); } count++; } } catch (JSONException e) { e.printStackTrace(); } }); }
... View more
08-01-2016
04:56 AM
|
0
|
8
|
1748
|
POST
|
public void markerClick() { mvHelper.setOnGraphicClickListener(new OnGraphicClickListener() { @Override public void onGraphicClick(Graphic graphic) { double gX, gY; //mvHelper.setShowGraphicCallout(false); gX = ((Point)graphic.getGeometry()).getX(); gY = ((Point)graphic.getGeometry()).getY(); Point p = new Point(gX, gY); Point newPoint = (Point) GeometryEngine.project(p, arcMap.getSpatialReference(), SpatialReference.create(4326)); Toast.makeText(ctx, String.valueOf(newPoint.getX()) + " " + String.valueOf(newPoint.getY()), Toast.LENGTH_LONG).show(); } }); } 2016-07-31 7:29 GMT+01:00 libin qi <geonet@esri.com>: GeoNet <https://community.esri.com/?et=watches.email.thread> Marker onClickListener reply from libin qi <https://community.esri.com/people/ymzzx?et=watches.email.thread> in *ArcGIS Runtime SDK for Android* - View the full discussion <https://community.esri.com/message/624939?et=watches.email.thread#comment-624939>
... View more
08-01-2016
03:03 AM
|
1
|
0
|
443
|
POST
|
Thx Eric, for the moment the code do the job, i need one more thing, i need to create polygons usings mapViewHelper cuz the standard method does not allow me to set a title and a subtitle to the polygon Le 30 juil. 2016 20:02, "Eric Bader" <geonet@esri.com> a écrit : GeoNet <https://community.esri.com/?et=watches.email.outcome> Marker onClickListener Eric Bader <https://community.esri.com/people/ebader-esristaff?et=watches.email.outcome> marked Alexander Nohe <https://community.esri.com/people/ANohe-esristaff?et=watches.email.outcome>'s reply on Marker onClickListener <https://community.esri.com/thread/180462?et=watches.email.outcome> as helpful. View the full reply <https://community.esri.com/message/624502?et=watches.email.outcome#comment-624502>
... View more
07-30-2016
01:25 PM
|
0
|
0
|
443
|
POST
|
How to create polygon using mapviewhelper addPolygonGraphic !?
... View more
07-29-2016
05:03 AM
|
0
|
2
|
1445
|
Title | Kudos | Posted |
---|---|---|
1 | 08-01-2016 03:03 AM | |
1 | 07-28-2016 10:01 AM |