POST
|
If you want to add ESRI Mobile controls in Visual Studio 208 you will have to install the Mobile SDK.
... View more
05-05-2011
08:15 AM
|
0
|
0
|
518
|
POST
|
I was implementing this also and was running into the same problem as you. What is missing is converting the graphic to WebMercator too. I am just working with points so this is what I did to get them show up on map array.push(new Graphic(WebMercatorUtil.geographicToWebMercator(shpPoint.toPoint()), new SimpleMarkerSymbol(styleMark.text.replace(repPattern,"").toLowerCase(),sizeMark.value,cpMark.selectedColor,alphaMark.value/100), dbfRecord.values));
array.push(new Graphic(WebMercatorUtil.geographicToWebMercator(shpPoint.toPoint()), txtSym, dbfRecord.values));
... View more
04-26-2011
11:15 AM
|
0
|
0
|
440
|
POST
|
I assume you asking how to edit in general. I am not sure about the sample you are talking about but here is a code snippet of taking the map click and making a map point and saving to feature layer private void map1_MouseDown(object sender, MouseButtonEventArgs e)
{
if (createPoint)
{
System.Windows.Point clickPoint = e.GetPosition(map1);
getMapClick(clickPoint);
createPoint = false;
}
}
private void getMapClick(System.Windows.Point clickPoint)
{
try
{
Envelope env = map1.GetRotatedExtent();
Coordinate coord;
//GeoTransformation geoTransform = new GeoTransformation(SpatialReference.Create(3857)); // WGS 1984 Web Mecrator Auxiliary Sphere transformer
//SpatialReferenceConverter src = new SpatialReferenceConverter(SpatialReference.CreateWgs84SpatialReference(), SpatialReference.Create(3857), geoTransform);
System.Drawing.Point point = new System.Drawing.Point(Convert.ToInt32(clickPoint.X), Convert.ToInt32(clickPoint.Y));
coord = map1.ToMap(point);
//System.Windows.MessageBox.Show("map coord" + coord.X.ToString() + " " + coord.Y.ToString());
saveNewObservation(new ESRI.ArcGIS.Mobile.Geometries.Point(coord));
}
catch (Exception ex)
{
System.Windows.MessageBox.Show(ex.Message.ToString(), "Map Click Error");
}
}
private void saveNewObservation(ESRI.ArcGIS.Mobile.Geometries.Point point)
{
try
{
//get feature layer
FeatureLayer featureLayer = getFeatureLayer("Observations", mobileCache);
//if still null
if (featureLayer == null)
{
System.Windows.MessageBox.Show("Could not find feature layer 'Observations' in map cache", "Search Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
//create datareader
FeatureDataTable featDataTable = featureLayer.GetDataTable(new QueryFilter());
DataRow newFeatDataRow = featDataTable.NewRow();
newFeatDataRow[featDataTable.GeometryColumnIndex] = point;
//populate new row with some defatul data values
newFeatDataRow["OBSERVATIONID"] = "1";
newFeatDataRow["TYPEID"] = 1;
newFeatDataRow["STATUS"] = "Active";
newFeatDataRow["CREATEDATE"] = DateTime.Now;
featDataTable.Rows.Add(newFeatDataRow);
//now save edits
featureLayer.SaveEdits(featDataTable);
featDataTable.Dispose();
featureLayer = null;
}
catch (Exception e)
{
System.Windows.MessageBox.Show(e.Message.ToString(), "saveNewObservation");
}
}
... View more
04-21-2011
09:28 AM
|
0
|
0
|
176
|
POST
|
1) Did you set the custom extent in the dataframe of the mxd? Though would think you would of seen errors in your server log concerning that. 2) Can you create the mobile cache using the tools in ArcToolbox? Nice thing about using the create mobile cache tool is you can check on the GP process in the results window.
... View more
04-06-2011
05:17 PM
|
0
|
0
|
211
|
POST
|
try also removing the graphic from the map, clearing geometry bag and add back to map map.MapGraphicLayers.Remove(currentGraphicLayer);
currentGraphicLayer.GeometryBag.Clear();
map.MapGraphicLayers.Add(currentGraphicLayer);
... View more
04-06-2011
01:25 PM
|
0
|
0
|
121
|
POST
|
Is this WPF or WinForms? If WPF- here is what I did glSelected = new GraphicLayer();
//create brush for fill
System.Windows.Media.SolidColorBrush myBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Aqua);
// Create a Pen to add to the GeometryDrawing created above.
System.Windows.Media.Pen myPen = new System.Windows.Media.Pen();
myPen.Brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Aquamarine);
glSelected.Fill = myBrush;
glSelected.DrawingPen = myPen;
_map.MapGraphicLayers.Add(glSelected);
//.....get geometry
glSelected.GeometryBag.Add(m_geometry);
... View more
11-10-2010
10:57 AM
|
0
|
0
|
295
|
POST
|
If you start looking under the hood at what mobileSync is doing through debugger- it basically ends up looping through each feature layer and calling a full featurelayersyncagent on each one. What you can do instead is loop through each feature layer, create a featurelayersync and set download direction and download filter. These greatly speeds up the sync process time. If you still do not see the new data- try calling a map refresh. You could also dive into your featurelayersynresult and see if any exceptions are occuring. I have found any exceptions that happen in the sync do not bubble up to the application. You have to wrtie code to check all the exceptions and if any display the error.
... View more
11-02-2010
11:00 AM
|
0
|
0
|
518
|
POST
|
To draw (display) the graphic you need to add your graphiclayer to the map using mapcontrol.MapGraphicLayer.Add(yourgraphiclayer) To add geometry (points, lines, polygons) to the graphic layer- you need to add them to the graphic layer geometrybag.
... View more
11-01-2010
07:45 AM
|
0
|
0
|
546
|
POST
|
I know with the WPF controls you can program in VS 10. You just have to declare the controls in the xaml tag. <my:Map Name="map1" xmlns:my="clr-namespace:ESRI.ArcGIS.Mobile.WPF;assembly=ESRI.ArcGIS.Mobile" /> I have not tried with Win Form controls but I image you could just go to the <name of page>.Designer.vb - for vb or <name of page>.designer.cs - for cs. and declare them manually in there as long as you have the libraries referenced in your application. vb snippet Me.mapControl = New ESRI.ArcGIS.Mobile.Map Me.MobileCache1 = New ESRI.ArcGIS.Mobile.MobileServices.MobileCache(Me.components) Me.MobileServiceConnection1 = New ESRI.ArcGIS.Mobile.MobileServices.MobileServiceConnection(Me.components) I know it's a pain but hopefully this will be fixed with first service pack.
... View more
10-18-2010
06:04 AM
|
0
|
0
|
238
|
POST
|
Sorry- yes I am using WPF. still trying to get it to stop flickering
... View more
10-15-2010
10:23 AM
|
0
|
0
|
547
|
POST
|
I received the instructions for deploying to windows for 10. Apparently there is 4 dll libaries you need to include and a symbol folder if you are using ESRI streetmap. See attachment for how to deploy. Yeah- don't have to install runtime on each machine.
... View more
10-11-2010
07:42 AM
|
0
|
0
|
577
|
POST
|
Have you gotten any where with this? I need to remove the flicker as well. I have been doing some testing, it you use the pan or zoom in, zoom out mapactions- there have this nice fade transition to them. If you call pan, zoom in, zoom out from the map control (like in code), you get a whole map redraw. Exactly like the GPS. It seems to wipe the map and redraw. I am guessing that somehow I need to apply a transition to get rid of the flicker.
... View more
10-11-2010
05:56 AM
|
0
|
0
|
547
|
POST
|
Hey- glad you figured it out. But I am putting a code snippet anyway for others to see- and this shows getting the geometry and another way to get access to data values for all records in the layer. And the only reason I know to call Read() because of working with datareaders for calls directly to database. FeatureDataReader featDataReader = featureLayer.GetDataReader(new QueryFilter());
while (featDataReader.Read())
{
String theName = featDataReader["Name"].ToString(); //you can use column index or column name
Geometry m_geometry = featDataReader[featDataReader.GeometryColumnIndex] as Geometry;
}
... View more
10-04-2010
06:38 AM
|
0
|
0
|
219
|
POST
|
Yes I have submitted the ticket and not getting anywhere yet with it. I need to set aside a whole day and build multiple examples in 10 and 9.3.1 to try and show ESRI what is going on. When I get something more out of them I will post it.
... View more
09-30-2010
06:50 AM
|
0
|
0
|
577
|
POST
|
Try using single quotes around the value. string whereClause = "TEAM_ID = 'Team A'";
... View more
09-30-2010
06:46 AM
|
0
|
0
|
219
|
Title | Kudos | Posted |
---|---|---|
1 | 02-06-2015 08:16 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|