|
POST
|
1) Is it possible to bind info Window mentioned http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm#jssamples/widget_popupfl.html on click to show some fields from the same node where lat lng is stored. 2) Since my data is coming from sql server and converted to xml my second question is that is it posible to display line feature and polygon feature ? Please post a new question rather than reviving a nearly two year old thread.
... View more
07-20-2012
06:34 AM
|
0
|
0
|
2293
|
|
POST
|
It sounds like you're referencing an old version of that sample. The current version has:
{
region: "west",
title: "left panel",
width: 150,
split: true,
collapsible: true,
html: "left panel content. this panel is collapsible and can be resized using the splitter",
listeners: {
collapse: resizeMap,
expand: resizeMap
}
}
resizeMap is:
function resizeMap() {
map.resize();
}
IIRC, the sample was updated at the 3.0 release to include the expand event listener to address the problem you're describing.
... View more
07-19-2012
06:06 AM
|
0
|
0
|
913
|
|
POST
|
Glad it's working. To close the loop on serializing a graphic to JSON, using the multiple graphics layers sample, you would do something like this:
dojo.toJson(map.getLayer(map.graphicsLayerIds[0]).graphics[0].toJson());
Which results in:
{"geometry":{"x":-10590229.129506975,"y":4802418.958195844,"spatialReference":{"wkid":102100}},"attributes":{"FID":1496,"CITY_FIPS":"02900","CITY_NAME":"Atchison","STATE_FIPS":"20","STATE_NAME":"Kansas","STATE_CITY":"2002900","TYPE":"city","CAPITAL":"N","ELEVATION":810,"POP1990":10656,"HOUSEHOLDS":3877,"MALES":4976,"FEMALES":5680,"WHITE":9557,"BLACK":848,"AMERI_ES":66,"ASIAN_PI":85,"OTHER":100,"HISPANIC":270,"AGE_UNDER5":755,"AGE_5_17":2088,"AGE_18_64":5841,"AGE_65_UP":1972,"NEVERMARRY":2394,"MARRIED":4193,"SEPARATED":76,"WIDOWED":909,"DIVORCED":722,"HSEHLD_1_M":396,"HSEHLD_1_F":768,"MARHH_CHD":978,"MARHH_NO_C":1044,"MHH_CHILD":50,"FHH_CHILD":322,"HSE_UNITS":4267,"VACANT":390,"OWNER_OCC":2620,"RENTER_OCC":1257,"MEDIAN_VAL":31400,"MEDIANRENT":188,"UNITS_1DET":3298,"UNITS_1ATT":38,"UNITS2":223,"UNITS3_9":210,"UNITS10_49":179,"UNITS50_UP":129,"MOBILEHOME":157},"symbol":{"color":[0,0,255,255],"size":12,"angle":0,"xoffset":0,"yoffset":0,"type":"esriSMS","style":"esriSMSCircle","outline":{"color":[0,0,0,255],"width":1,"type":"esriSLS","style":"esriSLSSolid"}}}
... View more
07-17-2012
10:06 AM
|
0
|
0
|
2010
|
|
POST
|
Let's simplify... can you post the JSON from your graphics that you're passing to esri.graphicsExtent? Each graphic has a toJson method. Coupled with dojo.toJson(), you can serialize graphics to text that you can post here.
... View more
07-17-2012
09:30 AM
|
0
|
0
|
2010
|
|
POST
|
Use popup.show(). You'll probably also want to use popup.setFeatures() to specify what is displayed in your popup when you show it.
... View more
07-17-2012
09:29 AM
|
0
|
0
|
855
|
|
POST
|
Yes. Starting with a map with full US as extent, I'm placing 2 graphics on it about 3 miles apart. It zooms to the correct area with the 2 graphics just outside of the view. Can you post code to reproduce this?
... View more
07-17-2012
08:25 AM
|
0
|
0
|
2010
|
|
POST
|
Apologies for being slow on this one. I haven't gotten a definitive answer yet but in my testing it looks like the features from your KML file are not supported.
... View more
07-17-2012
06:10 AM
|
0
|
0
|
2015
|
|
POST
|
If that's true, then that would be a bug. Are you certain the array you're passing to esri.graphicsExtent contains all of your graphics?
... View more
07-17-2012
06:05 AM
|
0
|
0
|
2010
|
|
POST
|
Are you able to make an edit via the REST API directly? These issues are not easy to troubleshoot via the user forum. If you're able, I recommend opening a ticket with support.
... View more
07-17-2012
06:01 AM
|
0
|
0
|
1726
|
|
POST
|
Map.setExtent takes a second (boolean) parameter that says whether or not the map should be forced to fit the entire extent passed to it. Try:
my_map.setExtent(esri.graphicsExtent(EDDM_map.graphics.graphics), true);
... View more
07-17-2012
05:59 AM
|
0
|
0
|
2010
|
|
POST
|
Attached is what I'm running locally. My goal is to have an info window popup when I click on a parks feature that shows the Parks name and a link to the County website. Thanks. Have you tried incorporating the code from the sample you referenced in your first post? Give it a shot and post back here if/when you run into specific errors/issues.
... View more
07-16-2012
06:37 AM
|
0
|
0
|
1268
|
|
POST
|
What have you tried? Do you have the sample using the Tree service running locally? Please post code showing what you're trying to do.
... View more
07-16-2012
05:50 AM
|
0
|
0
|
1268
|
|
POST
|
Any way to make that code universal for other tasks I will add in later (a GP task for example) or do I have to use this code each time I show results for my tasks? A better way to do this would be to set outSpatialReference on your findParams to match your map's spatial reference. For instance:
findParams = new esri.tasks.FindParameters();
findParams.returnGeometry = true;
findParams.layerIds = [9, 10, 11, 12, 13, 14, 15, 16, 17, 18];
findParams.searchFields = ["FARM_NAME", "LF_NAME", "COMPANY", "FACILITY", "NAME", "Company"];
findParams.outSpatialReference = map.spatialReference;
That way you don't need to do anything other than add the results to your map in your callback:
//Display results for Find tool
function showResults(results){
var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
map.graphics.clear();
dojo.forEach(results, function(result){
var graphic = result.feature;
graphic.setSymbol(markerSymbol);
map.graphics.add(graphic);
});
}
... View more
07-13-2012
12:29 PM
|
0
|
0
|
1240
|
|
POST
|
Everything is working as expected, but the map service you're querying is in geographic coordinates (lat, long). The find task is returning data, and it's being added to the map. The issue is that your points are in lat, long while the map is in web mercator. This causes your points to be plotted off the coast of Africa: [ATTACH=CONFIG]16077[/ATTACH] The quickest fix for this is to use esri.geometry.geographicToWebMercator to convert your geographic coordinates to web mercator. Here's a modified version of your callback function that handles the find task results:
function showResults(results){
var markerSymbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 10, new esri.symbol.SimpleLineSymbol(esri.symbol.SimpleLineSymbol.STYLE_SOLID, new dojo.Color([255, 0, 0]), 1), new dojo.Color([0, 255, 0, 0.25]));
map.graphics.clear();
dojo.forEach(results, function(result){
result.feature.geometry = esri.geometry.geographicToWebMercator(result.feature.geometry);
var graphic = result.feature;
graphic.setSymbol(markerSymbol);
map.graphics.add(graphic);
});
}
... View more
07-13-2012
08:43 AM
|
0
|
0
|
1240
|
|
POST
|
Here is the example with 10.1 sample WorldTimeZones service. Thanks for posting that. My only note would be to use sampleserver6 as opposed to servicesbeta4 as sampleserver6 is a 10.1 final AGS instance while servicesbeta4 is a 10.1 beta 2 instance: http://sampleserver6.arcgisonline.com/arcgis/rest/services/WorldTimeZones/MapServer/WMTS
... View more
07-13-2012
08:03 AM
|
0
|
0
|
1544
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-23-2012 07:54 AM | |
| 1 | 05-28-2010 08:31 AM | |
| 1 | 11-12-2012 08:12 AM | |
| 3 | 02-23-2012 10:57 AM | |
| 1 | 06-27-2011 08:51 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|