|
POST
|
When using your map service, does the query return any features back? What's the value of featureSet for showResults? What feature type is your map layer?
... View more
08-27-2013
07:35 AM
|
0
|
0
|
598
|
|
POST
|
Change esri.symbol.SimpleFillSymbol.STYLE_NONE to esri.symbol.SimpleFillSymbol.STYLE_NULL
... View more
08-26-2013
08:26 PM
|
0
|
0
|
598
|
|
POST
|
No feature returned is because you set returnGeometry = false. Change: q.returnGeometry = false;
q.outFields = ["ASSET_NAME,ASSET_TYPE"]; To: q.returnGeometry = true;
q.outFields = ["ASSET_NAME","ASSET_TYPE"];
... View more
08-26-2013
08:11 PM
|
0
|
0
|
1158
|
|
POST
|
To be able to overlay a graphic onto a map with different spatial reference correctly, reproject has to be done. Either JASPI can take care of it for us, or else we have to handle that ourselves. To figure out whether JSAPI takes the responsibility, the best way is to look at the source. We can also try it out though. But nevertheless, I do agree that since map and the graphic to be added both have the spatial reference provided, it will be better for the JSAPI to take care of the reproject for us.
... View more
08-26-2013
01:49 PM
|
0
|
0
|
1031
|
|
POST
|
Which JSAPI version are you using? This is the excerpt of the api source for project method: project : function(_1e, _1f, _20, _21) { var _22 = _2.mixin({}, this._url.query, { f : "json" }), _23; ... From the source, the error message means this._url is not defined. Check the code where geometryService is defined, making sure the correct url is fed into the constructor.
... View more
08-26-2013
01:07 PM
|
0
|
0
|
1031
|
|
POST
|
I am afraid that trying to catch the errors in your code would be the only way to prevent the error handled in JSAPI. Javascript exception handling is much similar to the way designed in OOP languages. When an exception occurs, it will try to be processed inside the code block where the exception is generated. If not, it will flow up along its invocation chain to the upper level until it's been processed. If no code is to capture the exception, the default handler will take into place. I agree that it is very annoying when the exception is captured in JSAPI. But it's better to get informed something wrong in the code than ignoring the errors. I would love to know there is a better way:)
... View more
08-26-2013
10:19 AM
|
0
|
0
|
1901
|
|
POST
|
I would reproject the gpsPoint after set its lat/lon. The code will look like this. if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(location) {
gpsPoint.setLatitude(location.coords.latitude);
gpsPoint.setLongitude(location.coords.longitude);
projectToMapCoords(gpsPoint);
});
}
function projectToMapCoords(gpsPoint) {
// Project gpsPoint to State Plane
var projectParams = new esri.tasks.ProjectParameters();
projectParams.geometries = [gpsPoint];
projectParams.outSR = map.spatialReference;
geometryService.project(projectParams, projectCallback);
}
function projectCallback(projectParams) {
var newPoint;
if (projectParams.length > 0) {
newPoint= projectParams[0];
gpsGraphic.setGeometry(newPoint);
gpsGraphic.setSymbol(gpsSymbol);
map.graphics.add(gpsGraphic);
map.centerAndZoom(newPoint, 12);
gpsIsOn = true;
}
} The code assumes that map, gpsPoint, geometryService, gpsSymbol, and gpsIsOn are global variables. If not, change the code accordingly to apply the variable scope.
... View more
08-26-2013
09:45 AM
|
0
|
0
|
1031
|
|
POST
|
Change mapDiv style as: #mapDiv {
width: 100%;
height: 100%;
overflow: hidden;
} Change BODY as: <body class="claro">
<div id="mainContainer" data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="design:'sidebar', gutters:true, liveSplitters:true" style="width:100%; height:100%">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'leading'" style="width: 200px;">
<div id="tc1-prog"></div>
</div>
<div id="mapDiv" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region: 'center'">
<!--<div id="mapDiv"></div>-->
</div>
</div>
</body>
... View more
08-26-2013
06:30 AM
|
0
|
0
|
671
|
|
POST
|
As Ben pointed out, I don't think you can hide the feature layers and still able to edit them. One thing you may be able to do is to display the feature layers when in edit mode only, and hide them when not. Here is the workflow at conceptual level. Hide all the feature layers to be edited initially. Show the feature layer(s) in edit when the app enters the edit mode. In doing so, the app should provide a way to trigger that, like click a button, or select an editing layer from a list, or click the feature template, etc. Hide the feature layer(s) when the app exits the edit mode. Again, the app should have a way for doing that.
... View more
08-23-2013
04:50 PM
|
0
|
0
|
570
|
|
POST
|
As to accessing the attributes, Javascript API should meet most of your needs. Check QueryTask, FeatureLayer.queryFeatures etc. Here are many query related samples available: https://developers.arcgis.com/en/javascript/jssamples/#search/query. One thing for sure, JS API can never completely reach the ability ArcObjects can. That's why SOE is needed sometime. But JS API is well designed to meet most of your online mapping needs. As to your specific question, here are the counterpart classes I can think of to match the ability of the listed ArcObjects classes. esri.layers.FeatureLayer: com.esri.arcgis.carto.FeatureLayer; com.esri.arcgis.carto.IFeatureLayer; esri.Graphic: com.esri.arcgis.geodatabase.Feature; com.esri.arcgis.geodatabase.IFeature; // no good match from JS API. But you should be able to accomplish most of the abilities by // combining the power of esri.Graphic, esri.layers.FeatureLayer, esri.layers.GraphicsLayer com.esri.arcgis.geodatabase.IFeatureClass; FeatureSet: object returned from the queryTask, featureLayer.queryFeatures, and featureLayer.selectFeatures. com.esri.arcgis.geodatabase.IFeatureCursor; esri.tasks.Query: com.esri.arcgis.geodatabase.IQueryFilter; com.esri.arcgis.geodatabase.ISpatialFilter; com.esri.arcgis.geodatabase.QueryFilter; com.esri.arcgis.geodatabase.SpatialFilter; esri.geometry.Polygon: com.esri.arcgis.geometry.Polygon;
... View more
08-22-2013
07:32 PM
|
0
|
0
|
477
|
|
POST
|
I could not reproduce the issue using FireFox or Chrome either. Your code posted looks good to me. If more than one client event triggered by a single click, more than likely, you have defined the same event handler multiple times like in a loop. Check your code making sure an event handler only defined once.
... View more
08-22-2013
07:21 PM
|
0
|
0
|
3158
|
|
POST
|
I am not a java programmer, and cannot understand how you pass the lat/lon from the java bean to the two input controls. In addition, I don't see any code that will use the given lat/lon to zoom the map around. Can you get the lat/lon values from the url or java bean?
... View more
08-22-2013
06:40 PM
|
0
|
0
|
1692
|
|
POST
|
1. Zach is right. Make a copy of evt object passed to markpoint, and feed it to executeIdentifyTask. 2. Is the project task completed successfully? I noticed that since v3.6 (and you are using v3.6), the schema of project task is changed. Please refer to the ESRI document, https://developers.arcgis.com/en/javascript/jsapi/geometryservice.html#project. Try the revised markpoint function, assuming the project task works. function markpoint(evt) {
map.graphics.clear();
var evtCopy = evt;
var point = evt.mapPoint;
var symbol = new esri.symbol.SimpleMarkerSymbol().setStyle(esri.symbol.SimpleMarkerSymbol.STYLE_DIAMOND);
var graphic = new esri.Graphic(point, symbol);
var outSR = new esri.SpatialReference({ wkid: 27700});
map.graphics.add(graphic);
gsvc.project([ point ], outSR, function(projectedPoints) {
pt = projectedPoints[0];
graphic.setInfoTemplate(new esri.InfoTemplate("HERE?",
"<p> X: " + pt.x +
"<br /> Y: " + pt.y +
"</p>" +
"<input type='button' value='CONFIRM' onclick='executeIdentifyTask(evtCopy);' />" +
"<div id='latlong'></div>"));
map.infoWindow
.setFeatures([graphic])
.show(evtCopy.screenPoint, map.getInfoWindowAnchor(evtCopy.screenPoint));
});
}
... View more
08-22-2013
07:19 AM
|
0
|
0
|
988
|
|
POST
|
Run your site in Chrome, and open Developer Tools. Set a breakpoint at the first line inside the event handler function of serviceRequestLayer.onUpdateEnd, "serviceRequestSymbol = serviceRequestLayer.renderer.infos[0].symbol;". Reload the app and see if you can reach the breakpoint. If you cannot hit it, something wrong occurs before serviceRequestLayer is loaded. Is the app publicly accessible?
... View more
08-22-2013
06:37 AM
|
0
|
0
|
838
|
|
POST
|
Jeff, please mark this as answered so other developers may find it helpful for their conversion job. Thanks.
... View more
08-22-2013
06:18 AM
|
0
|
0
|
699
|
| 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
|