|
POST
|
Hi Stefan, If you switch to using the new release 10.1.1 we have implemented a new selection capability for graphics which I think does what you are after. When you select a graphic it adds a halo around it. So adding to the code we looked at yesterday to create a text symbol, you can select a graphic (which adds a halo) like this: //select the highlight color (if you don't it defaults to cyan) labelsGL.setSelectionColor(Color.green); //select the graphic so it has a halo labelsGL.select(labelID); [ATTACH=CONFIG]20829[/ATTACH] Hope that helps Mark
... View more
01-18-2013
12:14 AM
|
0
|
0
|
1051
|
|
POST
|
This post has been moved from the ArcGIS Runtime forum... can anyone help with this?
... View more
01-17-2013
06:56 AM
|
0
|
0
|
415
|
|
POST
|
Internally the API renders Chem Lights using a unique value renderer. Therefore this does not support labels out of the box. The other symbols for 2525C use a DictionaryRenderer which as you point out accept a Unique Designation which is your labelling item. If you want to have a label for a Chem Light, then you will need to render your own using a TextMarker in a graphics layer. The following code shows how this can be done. //graphics layer for labels GraphicsLayer labelsGL = new GraphicsLayer(); map.getLayers().add(labelsGL); //Make a graphic for the label TextSymbol labelSymb = new TextSymbol(12, "ABC", Color.blue); Point labelLocation = new Point(2191602.87,626172.13); Graphic labelGraphic = new Graphic(labelLocation, labelSymb); //add graphic to the graphics layer labelsGL.addGraphic(labelGraphic); You will of course need to consider how you place your labels. The location of the point may need to change slightly according to the zoom level of the map if your label is offset from the location of the chem light. So in conclusion it's possible,but it might involve a little more work than expected.
... View more
01-17-2013
12:33 AM
|
0
|
0
|
1051
|
|
POST
|
I've tested this against our internal release candidate for the next release and I can confirm: - Hit tests work (getGraphicIDs supplying x and y screen location) against graphics layers in a message group layer. The bug reported in release 1.0 throws a Null Pointer Exception. It now returns graphics ids. - The highlight now also works for these symbols. There is a special message type for highlighting or you can set a graphic to highlighted. The next release is going to be numbered 10.1.1 (aligning with other products) and is going to be available quite shortly. We are currently going through a QA process, so please watch this space.
... View more
01-15-2013
03:46 AM
|
0
|
0
|
1448
|
|
POST
|
Yes I agree this looks like a bug in the API. I've seen a very similar issue in another area of the API (Message Processor releated) which I believe was fixed in time for the next release. I'll confirm this and let you know what I find.
... View more
01-14-2013
10:59 AM
|
0
|
0
|
1448
|
|
POST
|
ODCostMatrix is a geoprocessing (GP) tool available in ArcGIS Desktop. In order to use this tool in a different client you would go through a workflow similar to: - Using Model Builder or a python script create a model which uses your GP tool. e.g. ODCostMatrix - Publish the tool either to ArcGIS Server or to a geo-processing package - Write an application to consume the published tool. If you are using the Runtime API for Java SE (this should not be confised with arcObjects based solutions like ArcGIS Engine) when you might write some code like this: // create a geoprocessor Geoprocessor geoprocessor = new Geoprocessor(url of endpoint with your tool); // provide input arguments List<GPParameter> gpInputParams = new ArrayList<GPParameter>(); gpInputParams.add(<appropriate instance of GPParameter>); // repeat for each input parameter // run geoprocessing task and process result // one of the options to run the geoprocessing task geoprocessor.executeAsync(...); You will note that I've suggested using executeAsync where you need to wire up an event handler for when the process completes. This allows your application to remain responsive whilst the GP tool is running. If you look in the sample application which comes with the SDK we have several examples showing you how to execute local and server based GP tools.
... View more
01-10-2013
12:32 AM
|
0
|
0
|
415
|
|
POST
|
This file isn't part of the runtime product. The Runtime isn't based on ArcObjects as it's a new product build from the ground up. The arcobjects.jar I believe is part of the ArcGIS Engine SDK which can be downloaded via your EDN account. If you are about to start on a new project, I would however encourage you to consider using the ArcGIS Runtime SDK instead which is where the main focus of our development work is happening for desktop / mobile based applications. Let me know what you are trying to do and I'll see if I can point you in the right direction. Mark
... View more
01-04-2013
02:34 AM
|
0
|
0
|
628
|
|
POST
|
You can of course check the type of Symbol in a Graphic. So for example if you have created a Polygon graphic with a simple fill symbol you can check this as follows: //get symbol test Symbol symb = complexPolyGraphic.getSymbol(); //is it a simple fill symbol? if (symb instanceof SimpleFillSymbol) { System.out.println("this is a simple fill symbol"); } Alternatively if you had a Mil-std-2525c graphic you could check this by using the following code: //get graphic Graphic graphic = mgl.getMessageProcessor().getGraphic("52853229-1e87-47b2-abca-07a1a1b991dd"); //get the symbol type for the graphic Symbol milSymb = graphic.getSymbol(); //is this a multi layer symbol? if (milSymb instanceof MultiLayerSymbol) { System.out.println("this is a multi layer symbol"); } So although the MultiLayerSymbol cannot be user created (only the message processor internals can do this), you can at least see the type of symbol being used by the graphic.
... View more
01-04-2013
02:10 AM
|
0
|
0
|
1730
|
|
POST
|
I'll see what we can do for a future release. I agree this would be easier control if it could be done in the API. The other attributes "minLabelScale" and "maxLabelScale" are for controlling the scales at which your labels are visible. Regards Mark
... View more
01-04-2013
01:49 AM
|
0
|
0
|
806
|
|
POST
|
Each Graphic has a symbol. If you have a graphics layer and you add some Polylines then you are likely to use a SimpleLineSymbol. If you have points in a graphics layer, you might use a SimpleMarkerSymbol. Internally the message processor uses MultiLayerSymbols, but there isn't anything you can do with these in the API. It's just been put there to allow future developments.
... View more
01-03-2013
07:33 AM
|
0
|
0
|
1730
|
|
POST
|
There isn't a method of achieving this in the API at the moment (maybe we should consider this for a future release). However there is a workaround, you can apply: In the runtime folder there is a file called .\resources\symbols\app6b\messagetypes\positionreport.json The file contains an entry for the symbolScaleFactor which you can edit (with great care). I would discourage you from changing any other values in this file. { "type": "position_report", "layerName": "position_reports", "renderer": { "type" : "dictionary", "description" : "", "dictionaryType" : "APP6B", "field" : "sic", "symbolScaleFactor" : 1.0, "labelsVisible" : true, "minLabelScale" : 10000000, "maxLabelScale" : 0 } } Does this help?
... View more
01-03-2013
06:57 AM
|
0
|
0
|
806
|
|
POST
|
We currently don't have a composite symbol in the API. If I can gather requirements then this can be considered for a future release. At the moment graphics (of all supported types) can be contained in a graphics layer. A graphics layer can be contained either in a group layer, or directly in a JMap control.
... View more
12-24-2012
01:25 AM
|
0
|
0
|
1735
|
|
POST
|
The purpose of the MultiLayerSymbol is only to identify the type of graphic used in the symbology we use for Mil-Std-2525C graphics. If you are working with graphics layers then in addition to SimpleMarkerSymbols have for example: - PictureMarkerSymbols - Polylines - Graphics Can you give me more detail of what you are trying to achieve?
... View more
12-24-2012
01:14 AM
|
0
|
0
|
1730
|
|
POST
|
If the QA process goes to plan you should see 10.1.1 in January. We are currently testing prior to release. The MultiLayerSymbol won't work for what you are trying to achieve at the moment. The purpose of the class is to identity the type of a graphic which is used to display MIL-STD-2525C or App6B symbols. If you want to move or highlight your graphics then they must be processed individually. This isn't going to be a big overhead on your application though, as this is exactly what the graphics layer is designed for. We have proven the graphics layer animating thousands of graphics so your sweep shouldn't present too much of a problem. You just need to write efficient code which doesn't use "new Class" repeatedly in loops for example. In terms of highlight, 10.1.1 has a much improved mechanism for performing this over the existing SelectionSymbol. You can now simply select a graphic and is shows a glow (configurable colour) around the graphic. The SelectionSymbol is of course still supported.
... View more
12-24-2012
01:03 AM
|
0
|
0
|
2052
|
|
POST
|
Hi There is quite a lot you can do with a simple graphics layer which you can add to the map. They are pretty efficient and work well with realtime updated displays. I've started by looking at how you can draw a line from an origin pointing in a given direction. Don't be put off by the amound of code, I've just added loads of debug graphics which are added to the screen so you can see how I'm building up the picture. Let me know if this helps you get started. I've added a tiled layer to the map and wired up a map click event: map = new JMap(); map.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { drawSweep(arg0); } }); window.getContentPane().add(map); ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer( "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"); map.getLayers().add(tiledLayer); When the user clicks on the map, a line will draw from the click point at an angle of 20 degrees east of north. A bearing of -20 or 340 degrees. private void drawSweep(MouseEvent mouseArgs) { //new graphics layer added to the map GraphicsLayer graphicsLayer = new GraphicsLayer(); map.getLayers().add(graphicsLayer); //get the position clicked on the map Point clickedPoint = map.toMapPoint(mouseArgs.getX(), mouseArgs.getY()); //construct an origin of 0,0 Point origin = new Point(0,0); //pop the origin on the map SimpleMarkerSymbol smsOrigin = new SimpleMarkerSymbol(Color.RED, 5, Style.CIRCLE); Graphic originGraphic = new Graphic(origin, smsOrigin); graphicsLayer.addGraphic(originGraphic); //make another point due north of the origin Point rotateMe = new Point(0,100000); //draw point due north on the map SimpleMarkerSymbol smsrotateMe = new SimpleMarkerSymbol(Color.BLUE, 5, Style.DIAMOND); Graphic rotateMeGraphic = new Graphic(rotateMe, smsrotateMe); graphicsLayer.addGraphic(rotateMeGraphic); //angle of rotation for heading from north position (converting to radians) double heading = 20 *( Math.PI / 180); //rotate 20 degrees Transformation2D td = new Transformation2D(); td.rotate(heading); rotateMe.applyTransformation(td); //draw rotated point SimpleMarkerSymbol smsRotated = new SimpleMarkerSymbol(Color.ORANGE, 5, Style.TRIANGLE); Graphic rotatedGraphic = new Graphic(rotateMe, smsRotated); graphicsLayer.addGraphic(rotatedGraphic); //now use the origin and the rotated point to make a line Polyline bearing = new Polyline(); bearing.startPath(origin); bearing.lineTo(rotateMe); bearing.closeAllPaths(); //make a symbol and graphic SimpleLineSymbol slsBearing = new SimpleLineSymbol(Color.CYAN, 2); Graphic bearingGraphic = new Graphic(bearing, slsBearing); graphicsLayer.addGraphic(bearingGraphic); //now the line can me moved to be somewhere else (like where we clicked on the map) Transformation2D transShift = new Transformation2D(); transShift.setShift(clickedPoint.getX(), clickedPoint.getY()); bearing.applyTransformation(transShift); //then drawing bearing (this is probably the only line you want to draw) SimpleLineSymbol slsShiftedBearing = new SimpleLineSymbol(Color.GREEN, 2); Graphic shiftedGraphic = new Graphic(bearing, slsShiftedBearing); graphicsLayer.addGraphic(shiftedGraphic); }
... View more
12-10-2012
11:40 AM
|
0
|
0
|
2052
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-13-2024 05:17 AM | |
| 1 | 07-10-2024 01:50 AM | |
| 1 | 04-22-2024 01:21 AM | |
| 1 | 04-18-2024 01:41 AM | |
| 1 | 12-05-2023 08:50 AM |
| Online Status |
Offline
|
| Date Last Visited |
03-12-2025
07:13 PM
|