|
POST
|
Is your app accessible publicly? Hard to say with the information provided. Generally speaking, I would open the app in Chrome, then right click one of the direction element and choose Inspect Element. It will open the Developer Tools, and showing the element along with its CSS rules on the right side. Find out what CSS class the target element has, and modify the css rules on the fly. When you satisfy with the new changes, change the CSS file in your app accordingly to make them permanent.
... View more
09-17-2013
05:44 AM
|
0
|
0
|
493
|
|
POST
|
Excellent. Glad to help. Please consider mark this thread as "Answered" so other people may find it helpful. Thanks.
... View more
09-17-2013
05:36 AM
|
0
|
0
|
923
|
|
POST
|
map in esri.dijit.BasemapGallery should refer to the map object used in your app, while _maps is an array of map objects. Matter of fact, _maps only contains one map object. Don't know why need an array here. Anyway, here is the change you can make. Try to change: var basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, map: _maps }, "basemapGallery"); To: var basemapGallery = new esri.dijit.BasemapGallery({ showArcGISBasemaps: true, map: _maps[0] }, "basemapGallery");
... View more
09-17-2013
05:16 AM
|
1
|
0
|
1133
|
|
POST
|
LayerInfos is not for tables, but layers only. Make call to the rest endpoint of the map service layers like the below code sample. var serviceLayersRequest = esri.request({ url: "http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Petroleum/KSPetro/MapServer/layers", // change to your url content: { f: "json" }, handleAs: "json", callbackParamName: "callback" }); serviceLayersRequest.then( function(response) { console.log("Success: ", response.layers); console.log("Success: ", response.tables); }, function(error) { console.log("Error: ", error.message); });
... View more
09-16-2013
02:46 PM
|
0
|
0
|
473
|
|
POST
|
I am not sure I understand your question clearly. If you like to query a subset of a layer data, set query.where to limit the result based on the attribute values. That's about the equivalent of definition expression if using Query. If you do need to use the real definition expression as used in ArcMap, create a FeatureLayer for the layer you like to query, and then set definition expression like the below sample: require(["esri/layers/FeatureLayer", ...], function(FeatureLayer, ...) {
var featureLayer = new FeatureLayer("rest/url/of/the/layer",{
mode: FeatureLayer.MODE_SELECTION,
outFields: ["*"]
});
featureLayer.setDefinitionExpression("STATE_NAME = 'South Carolina'");
...
});
You can further query against the featureLayer using featureLayer.queryFeatures. Hope it helps.
... View more
09-16-2013
01:14 PM
|
0
|
0
|
600
|
|
POST
|
Below solution assumes that in the scope where xhrArgs is defined, this.map can be accessible. Add a local variable 'self' to host the context where xhrArgs is defined, then use self.map inside the callback function based on closure. var self = this; var xhrArgs = { url: "/Map/getalerts", handleAs: "json", load: function (track) { var point = new Point(track.Latitude, track.Longitude, new SpatialReference({ wkid: 4326 })); var simpleMarkerSymbol = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 10, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 0, 0]), 1), new Color([0, 255, 0, 0.25])); var graphic = new Graphic(webMercatorUtils.geographicToWebMercator(point), simpleMarkerSymbol, { 'title': track.FullName, 'content': 'ID: 2<br/>TimeStamp: Some Time<br/>Message Type: Alert' }, new InfoTemplate('${title}', '${content}')); self.map.graphics.add(graphic); }, error: function (error) { console.log("An unexpected error occurred: " + error); } }
... View more
09-16-2013
12:26 PM
|
0
|
0
|
923
|
|
POST
|
Try to add one more dependency and make one more change. Dependency: "dojo/data/ObjectStore" Alias: ObjectStore Change: var store = new Memory({data:dataForGrid}); To: var store = new ObjectStore({ objectStore: new Memory({ data: dataForGrid }) });
... View more
09-16-2013
12:16 PM
|
0
|
0
|
940
|
|
POST
|
Do two things: 1. Add "dijit/registry" to the dependency list, and use registry as the alias. 2. Change: var grid = dom.byId('grid'); To: var grid = registry.byId('grid');
... View more
09-16-2013
10:58 AM
|
0
|
0
|
940
|
|
POST
|
Move below statement out of startEditing function. I don't know what will trigger to call startEditing. But every time it's invoked, onDrawEnd event handler will be defined one more time, which makes createFeature invoked one more time. I would recommend to define the onDrawEnd event handler in the same function where drawingToolbar instance is created so to ensure it's been defined once only. on(this.drawingToolbar, "draw-end", lang.hitch(this, this.createFeature, template));
... View more
09-16-2013
09:51 AM
|
0
|
0
|
764
|
|
POST
|
To include ESRI basemaps, make sure showArcGISBasemaps set to true when creating basemapGallery. If you like to only include subset of ESRI basemaps or like to reorder the basemaps in the gallery, you can create a basemap for each type, and add to the gallery in order. Below is the sample for including the esri basemaps and adding yours at the end. var basemapGallery = new esri.dijit.BasemapGallery({
showArcGISBasemaps: true,
map: map
}, "basemapGallery");
var basemapLayer = new BasemapLayer({
url:"url/of/empty/basemap/mapservice"
});
var emptyBasemap = new Basemap({
layers: [basemapLayer],
title: "Empty Basemap",
thumbnailUrl: "url/of/empty/image"
});
basemapGallery.add(emptyBasemap);
basemapGallery.startup();
... View more
09-13-2013
02:58 PM
|
2
|
1
|
1995
|
|
POST
|
Am I creating an ArcGISTiledMapServiceLayer? I would suggest to publish the empty map service as cached one, and DEFINE the scale levels exactly the same as any esri basemap, but do NOT create the tiled images. The ArcGIS Server will recognize it as tiled map service. The sample code explains what I meant assuming using AMD code style. var basemapLayer = new BasemapLayer({
url:"url/of/empty/basemap/mapservice"
});
var emptyBasemap = new Basemap({
layers: [basemapLayer],
title: "Empty Basemap",
thumbnailUrl: "url/of/empty/image"
});
basemapGallery.add(emptyBasemap);
... View more
09-13-2013
10:03 AM
|
0
|
0
|
1995
|
|
POST
|
I guess what you did is to create an empty basemap, and add it to the basemap gallery. Am I right? Please refer to the ESRI document. All basemaps added to the gallery need to have the same spatial reference. If the default ArcGIS.com basemaps are used then all additional items added to the gallery need to be in Web Mercator (wkids: 102100, 102113 and 3857). If the default basemaps are not used you can add basemaps in any spatial reference as long as all the items added to the gallery share that spatial reference. To achieve the best performance, it is recommended that all basemaps added to the gallery are cached (tiled) layers. Have you tried to create a blank map document with the spatial reference set to webMercator, and then publish it as a map service? In the code, Create a basemapLayer with the service just published. Create a basemap fed in the basemapLayer. Add basemap to the basemap gallery.
... View more
09-13-2013
09:28 AM
|
0
|
0
|
1995
|
|
POST
|
ok...one last try. Replace all your JS code with the below one with two assumptions: The basemaplayer spatial reference is the same as the map, 2953. The point coordinates in strPoints are lat/lon. var strPoints;
// add code to populate strPoints here.
require([
"esri/map",
"esri/geometry/Extent",
"esri/geometry/Point",
"esri/symbols/SimpleMarkerSymbol",
"esri/graphic",
"esri/tasks/GeometryService",
"dojo/_base/array",
"dojo/_base/lang",
"dojo/_base/Color",
"esri/layers/ArcGISDynamicMapServiceLayer",
"dojo/domReady!"
], function (Map, Extent, Point, SimpleMarkerSymbol, Graphic, GeometryService, arrayUtiles, lang,
Color, ArcGISDynamicMapServiceLayer) {
var initialExtent = new Extent({
"xmin": 2306896.79,
"ymin": 7278537,
"xmax": 2710915.5,
"ymax": 7674860.5,
"spatialReference": {
"wkid": 2953
}
}); //102100, 2953
var map = new Map("NBmap", {
extent: initialExtent
});
var basemaplayer = new ArcGISDynamicMapServiceLayer("http://swv25orat01.gnb.ca:6080/arcgis/rest/services/WFRS/WFRS_FireSummarymxd/MapServer");
map.addLayer(basemaplayer);
map.on("load", function() {
map.disablePan();
map.disableScrollWheelZoom();
map.hideZoomSlider();
var geometryService = new GeometryService("http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");
var arrycoord = strPoints.split(",");
var x, y, point;
var symbol = new SimpleMarkerSymbol(
SimpleMarkerSymbol.STYLE_CIRCLE,
16,
null,
new Color("#ce641d")
);
for (i = 0; i < arrycoord.length; i = i + 2) {
x = arrycoord;
y = arrycoord[i + 1];
point = new Point(x, y);
geometryService.project(point, map.spatialReference, function (newpoint) {
var graphic = new Graphic(newpoint, symbol);
map.graphics.add(graphic);
});
};
});
});
... View more
09-12-2013
12:21 PM
|
0
|
0
|
986
|
|
POST
|
Can you post your updated app and the data in strPoints? Must be some simple thing we missed.
... View more
09-12-2013
10:48 AM
|
0
|
0
|
986
|
|
POST
|
I forgot to create the graphic before adding to the map. Ok, try one of these two again. var x, y, point, graphic;
var symbol = createSymbol("#ce641d");
var srLatLon = new SpatialReference({ wkid: 4326 });
for (i = 0; i < arrycoord.length; i = i + 2) {
x = arrycoord;
y = arrycoord[i + 1];
point = new Point(x, y, srLatLon);
graphic = new Graphic(point, symbol);
map.graphics.add(graphic);
}; Or, var x, y, point, graphic;
var symbol = createSymbol("#ce641d");
var srLatLon = new SpatialReference({ wkid: 4326 });
for (i = 0; i < arrycoord.length; i = i + 2) {
x = arrycoord;
y = arrycoord[i + 1];
point = new Point(x, y, srLatLon);
geometryService.project(point, map.spatialReference, function (newPoint) {
var graphic = new Graphic(newPoint, symbol);
map.graphics.add(graphic);
});
}; Also change createSymbol function as: function createSymbol(color) {
return new esri.symbol.SimpleMarkerSymbol(
esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, // change to the style you like
16, // change to the size you like
null,
new dojo.Color(color)
);
};
... View more
09-12-2013
10:23 AM
|
0
|
0
|
2043
|
| 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
|