POST
|
Hi Jake, I tried a similar way but it still returns as "undefined" This is what i used, var attr = {"Xcoord":"test","Ycoord":"test1","Plant":"Mesa Mint"}; var graphic = new Graphic( new Point( point.coords ), createSymbol( iconPath, initColor ), attr ); nums.push(graphic.getContent()); map.graphics.add( graphic ); map.graphics.on("click", addPoint); } ); console.log(nums);
... View more
10-02-2014
12:23 PM
|
0
|
0
|
588
|
POST
|
function pinMap( ) { $.post( '{{ path( 'points' ) }}', {}, function( r ) { arrayUtils.forEach( r.points, function( point ) { var iconPath = "M15.834,29.084 15.834,16.166 2.917,16.166 29.083,2.917z"; var initColor = "#CF3A3A"; var graphic = new Graphic( new Point( point.coords ), createSymbol( iconPath, initColor ) ); graphic.setAttributes( {"Status": "test"}); map.graphics.add( graphic ); var conc = graphic.getContent(); alert(conc+" ArcGIS"); map.graphics.on("click", addPoint); } ); }, 'json' ); } function createSymbol( path, color ) { var markerSymbol = new esri.symbol.SimpleMarkerSymbol( ); markerSymbol.setPath( path ); markerSymbol.setColor( new dojo.Color( color ) ); markerSymbol.setOutline( null ); return markerSymbol; } This is the code I'm using.
... View more
10-02-2014
12:16 PM
|
0
|
0
|
1589
|
POST
|
Sorry, I used the same syntax: graphic.getContent(); It still returns - > undefined
... View more
10-02-2014
09:22 AM
|
0
|
0
|
1589
|
POST
|
It belongs to the graphic object. You can find the details here: graphic-amd | API Reference | ArcGIS API for JavaScript Basically, getContent() Returns the content string based on attributes and infoTemplate values. Return value: String
... View more
10-02-2014
08:41 AM
|
0
|
2
|
1589
|
POST
|
function pinMap( ) { $.post( '{{ path( 'points' ) }}', {}, function( r ) { arrayUtils.forEach( r.points, function( point ) { var iconPath = "M15.834,29.084 15.834,16.166 2.917,16.166 29.083,2.917z"; var initColor = "#CF3A3A"; var graphic = new Graphic( new Point( point.coords ), createSymbol( iconPath, initColor ) ); graphic.setAttributes( {"Status": "test"}); map.graphics.add( graphic ); var conc = getContent(); alert(conc+" ArcGIS"); map.graphics.on("click", addPoint); } ); }, 'json' ); }
... View more
10-02-2014
08:38 AM
|
0
|
0
|
588
|
POST
|
I'm creating a graphic for point to get it displayed on the map. I need to get the attribute values displayed in a pop up box, may be an infowindow will also work. The points are plotted on the map just fine but i can't see the attribute values to those points. this is the piece of code var graphic = new Graphic( myPoint, createSymbol( iconPath, initColor ) ); graphic.setAttributes( {"Status": "test"}); map.graphics.add( graphic ); There are like 100 points and so i'm running the a "for loop" for each point so that they can be added to the map. Similarly at the same time i'm assigning the attribute values to it. How to get those values ?? I tried to get the attribute values using: alert(getContent()+" Arcgis"); But in the alert window it returns: "undefined ArcGIS" It is returning the undefined value. It will be of a great help if anyone can help me out on this one.
... View more
10-02-2014
08:32 AM
|
0
|
7
|
6139
|
POST
|
I'm creating a graphic for point to get it displayed on the map. I need to get the attribute values displayed in a pop up box, may be an infowindow will also work. The points are plotted on the map just fine but i can't see the attribute values to those points. this is the piece of code var graphic = new Graphic( myPoint, createSymbol( iconPath, initColor ) ); graphic.setAttributes( {"Status": "test"}); map.graphics.add( graphic ); There are like 100 points and so i'm running the a "for loop" for each point so that they can be added to the map. Similarly at the same time i'm assigning the attribute values to it. How to get those values ?? I tried to get the attribute values using: alert(getContent()+" Arcgis"); But in the alert window it returns: "undefined ArcGIS" It is returning the undefined value. It will be of a great help if anyone can help me out on this one.
... View more
10-02-2014
08:27 AM
|
0
|
4
|
3446
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|