|
POST
|
In your case, no need to use multipoint. You only need to use multipoint if you like to group points together into one feature that share all the attributes. Ok. I found one issue. initialExtent uses 2953 as the spatial reference. But the coordinates of the points are in lat/lon, right? If so, here is the code sample. var x, y, point;
var initColor = "#ce641d";
for (i = 0; i < arrycoord.length; i = i + 2) {
x = arrycoord;
y = arrycoord[i + 1];
point = new Point(x, y, new SpatialReference({ wkid: 4326 }));
// it should work without reprojecting the point. If not working, then reproject it.
map.graphics.add(graphic); // comment this line out if using the reproject approach
//geometryService.project(point, map.spatialReference, function (newPoint) {
// var graphic = new Graphic(newPoint, createSymbol(initColor));
// map.graphics.add(graphic);
//});
};
... View more
09-12-2013
09:45 AM
|
0
|
0
|
2093
|
|
POST
|
Make the below change as well. Please make sure that the spatial reference for the (x,y) coordinates fed to multipoint is the same as map.spatialReference. From: var multipoint = new Multipoint(map.spatialReference);
for (i = 0; i < arrycoord.length; i = i + 2) {
var x = arrycoord;
var y = arrycoord[i + 1];
var point = new Point();
point.x = x;
point.y = y;
multipoint.addPoint(point);
}; To:
var x, y, point;
var multipoint = new Multipoint(map.spatialReference);
for (i = 0; i < arrycoord.length; i = i + 2) {
x = arrycoord;
y = arrycoord[i + 1];
point = new Point(x,y);
multipoint.addPoint(point);
}; One more question: is there any specific reason to use multipoint type instead of point directly?
... View more
09-12-2013
07:46 AM
|
0
|
0
|
2093
|
|
POST
|
You are welcome, Melo. Please consider to mark this thread as "Answered" so it may be helpful for others. Thanks.
... View more
09-12-2013
07:27 AM
|
0
|
0
|
1089
|
|
POST
|
No need to create navToolbar more than once. Once it's created, just use navToolbar.activate to activate its operation. Here is a sample code. function activateNavigation(navType) { if (navType) { navToolbar.activate(navType); // for some reason, when switch ZoomIn to ZoomOut or vice versa, the pan operation is enabled. // I believe it is a bug. Here is a workaround. if (navType !== "pan" && map.isPan) { map.disablePan(); } // set map cursor based on the navigation type switch (navType) { case esri.toolbars.Navigation.PAN: map.setMapCursor("move"); break; case esri.toolbars.Navigation.ZOOM_IN: case esri.toolbars.Navigation.ZOOM_OUT: map.setMapCursor("crosshair"); break; default: map.setMapCursor("default"); break; } } }
... View more
09-12-2013
06:40 AM
|
0
|
0
|
1089
|
|
POST
|
multipoint.points are not the type of Point geometry, but an array of coordinates in number type. Multipoint is a valid geometry type that can be fed into geometryService.project directly. Try to change: geometryService.project(multipoint.points, map.spatialReference, function (results) To: geometryService.project(multipoint, map.spatialReference, function (results)
... View more
09-12-2013
06:06 AM
|
0
|
0
|
2093
|
|
POST
|
Change: var operation = new esri.dijit.editing.Union({ deleted_graphics: [merge_from_feature], featureLayer: edit_featurelayer, preUpdatedGraphics: new esri.Graphic(original_feature), postUpdatedGraphics: [merge_to_feature] }); To: var operation = new esri.dijit.editing.Union({ deletedGraphics: [merge_from_feature], featureLayer: edit_featurelayer, preUpdatedGraphics: [new esri.Graphic(original_feature)], postUpdatedGraphics: [merge_to_feature] });
... View more
09-12-2013
05:59 AM
|
0
|
0
|
741
|
|
POST
|
I am confused. By default, zoom in/out function does not require to work with SHIFT key. Here is an sample.
... View more
09-12-2013
05:39 AM
|
0
|
0
|
1089
|
|
POST
|
Dynamic and Tiled map services are wrapped in DIV elements. But feature layers and graphics layers are wrapped in a SVG element. They do have _div property, but no _div.style. Try to use _dev.rawNode.style for feature layers and graphics layers.
... View more
09-12-2013
05:29 AM
|
0
|
0
|
289
|
|
POST
|
Try: switch(layer.declaredClass) {
case "esri.layers.ArcGISDynamicMapServiceLayer":
case "esri.layers.ArcGISImageServiceLayer":
case "esri.layers.WebTiledLayer":
...
}
... View more
09-12-2013
05:12 AM
|
0
|
0
|
457
|
|
POST
|
Thanks for pointing me to the function. It seems the point graphics are put underneath the polygons by design. Is there any specific reason for doing that? I think it is against the way people normally do. Matter of fact, people expect to see the graphics shown on the printout page the same order as shown on the map. With that being said, personally I think it is a bad idea to re-group the graphics out of a graphics layer based on the spatial type because more than likely it will break the order shown on the map anyway.
... View more
09-11-2013
11:15 AM
|
0
|
0
|
1002
|
|
POST
|
That might work. I will test it out though. But I really hate to create one graphics layer for polygons and maybe polylines, and another one for points and texts just to make it work for print. It sounds very awkward. EDIT: just tested it out, and Vinay's workaround does work. Thanks, Vinay. But I do like to see that ESRI can provide a permanent solution for this issue.
... View more
09-11-2013
09:44 AM
|
0
|
0
|
1002
|
|
POST
|
Thanks Vinay for quick reply. These graphics are added to the same graphics layer created other than map.graphics. You can reproduce the issue using this sample.
... View more
09-11-2013
09:34 AM
|
0
|
0
|
1002
|
|
POST
|
I've used the PrintTask to perform the print job. It performs well until I add some graphics, and found out that the points and texts ar printed underneath the polygons even if the points and texts are drawn on top of the polygons. Please see the attached images. The first image shows the partial screenshot from the app. One point sits on top of the circle, and another one sits under the circle. The second image is the printout image. Both points sit underneath the circles. Can ESRI look into this issue? [ATTACH=CONFIG]27358[/ATTACH] [ATTACH=CONFIG]27359[/ATTACH]
... View more
09-11-2013
09:07 AM
|
0
|
6
|
1739
|
|
POST
|
Interesting. This sample does use where clause for the statistical calculation, and it works. The main difference I can tell is the sample uses a feature layer that supports statistics, while rokitmaps uses a feature service.
... View more
09-11-2013
08:43 AM
|
0
|
0
|
2846
|
|
POST
|
It seems like spaces are not welcomed for outStatisticFieldName. Try to change: statDef.outStatisticFieldName = "Tot Area"; To: statDef.outStatisticFieldName = "TotArea";
... View more
09-11-2013
08:07 AM
|
0
|
0
|
2846
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-17-2013 05:16 AM | |
| 1 | 11-06-2013 04:34 AM | |
| 1 | 08-29-2013 10:58 AM | |
| 6 | 10-20-2020 02:09 PM | |
| 1 | 11-20-2013 06:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
10-17-2024
08:41 AM
|