POST
|
I cannot write the whole application here, but can give you directions. select lat and long by click on map, and select radius 5,10, 15 miles - You have the part where you can click the map and get lat long, You would need UI where the user can select radius. then the button click event ->and data comes from sql is converted to json-> from json - this is tricker. Usually, I would have a REST service which will receive the response and return the JSON. But you have codebehid do this for you. So I am guessing The page will be a post request to the server. which will update the "var markers = JSON.parse('<%=ConvertDataTabletoString() %>');" value how to add circles on map - That is what I have shown you in my previous snippet. You would have to loop through all the markers and then create new Graphic for each of the record in the markers. I am not sure what the structure of the "markers" is. But say if it is an array of lat and long. You will have to do something like below. map.on("load", addQueryResult);
function addQueryResult(){
if(markers && markers.length > 0){
for(var i = 0; i < markers.length;i++){
var lat = markers[i].lat;
var long = markers[i].long;
var symbol = 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 pt = new Point(long, lat);
var graphic = new Graphic(pt, symbol);
// Adding the graphics to map, you could instead
// create a GraphicsLayer and add it to them
map.graphics.add(graphic);
}
}
}
... View more
06-20-2017
10:14 AM
|
0
|
0
|
1536
|
POST
|
Thats not an ideal way to do. But, if it works for you, good. Below I have modified your script to add point from the map click, but you would have to use the "markers" values can create graphics after the map has loaded. require([ "esri/map", "esri/Graphic", "esri/symbols/SimpleMarkerSymbol",
"esri/symbols/SimpleLineSymbol", "esri/Color", "esri/geometry/Point", "dojo/domReady!"],
function (Map, Graphic, SimpleMarkerSymbol, SimpleLineSymbol, Color, Point) {
map = new Map("map", {
basemap: "osm",
center: [-122.9007, 47.0379],
zoom: 9,
scaleControl: true
});
map.on("load", function () {
map.infoWindow.resize(250, 100);
});
map.on("click", addPoint);
function addPoint(evt) {
var lat = evt.mapPoint.getLatitude();
var long = evt.mapPoint.getLongitude();
document.getElementById("ContentPlaceHolder1_txtLat").value = lat;
document.getElementById("ContentPlaceHolder1_txtLng").value = long;
var symbol = 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 pt = new Point(long, lat);
var graphic = new Graphic(pt, symbol);
// Adding the graphics to map, you could instead
// create a GraphicsLayer and add it to them
map.graphics.add(graphic);
}
}); Take a look at the sample as well Add graphics to a map | ArcGIS API for JavaScript 3.20
... View more
06-20-2017
09:43 AM
|
1
|
1
|
1536
|
POST
|
What rscheitlin meant is, the javascript you have shared in the post does not have any implementation where you are reterieving any kind of SQL value from the database. All you are doing is adding a map and handling a map click event. How are you getting the SQL values to the client side? esriRequest or some ajax calls?
... View more
06-20-2017
09:09 AM
|
0
|
3
|
1536
|
POST
|
Which version of the api are you using? You could a always use the json to create the renderer like below renderer: new SimpleRenderer({
"type": "simple",
"label": "",
"description": "",
"symbol": {
"color": [210,105,30,191],
"size": 6,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [0,0,128,255],
"width": 0,
"type": "esriSLS",
"style": "esriSLSSolid"
}
}
}) Make sure all the properties provided are valid, otherwise they will be ignored.
... View more
06-20-2017
06:00 AM
|
0
|
0
|
508
|
POST
|
Why are you creating a GraphicLayer for each graphic/Text label? If you move the Layer part out side the loop you can have one GraphicLayer with multiple graphics. Then you will have only one Layer to add. var cLayer = new GraphicsLayer();
for(var i=0; i <= mappoint.length;i++){
var Textsymbol= new TextSymbol();
Textsymbol.setAlign(TextSymbol.ALIGN_MIDDLE);
Textsymbol.setOffset(0, 13);
Textsymbol.setText(number);
var graphic = new Graphic(new Point(parseFloat(lat),
parseFloat(lat), wgs), Textsymbol);
cLayer.add(graphic);
}
cLayer.setMaxScale(0);
cLayer.setMinScale(288895.277144);
labelArray.push(cLayer ); // Or add it directly to map
... View more
06-20-2017
05:42 AM
|
1
|
0
|
1988
|
POST
|
Can you share the code where you are getting the error?
... View more
05-24-2017
05:46 AM
|
2
|
1
|
515
|
POST
|
Jay, The features property in the parameter for popup.open method, is an array of Graphics, not a single feature. Also content will not take attributes, below is the documentation of Popup.content. The content of the popup. When set directly on the Popup, this content is static and cannot use fields to set content templates. To set a template for the content based on field or attribute names, see PopupTemplate.content. Do you get any errors in the console? See if setting popup.visible = true helps.
... View more
05-22-2017
08:42 AM
|
0
|
0
|
987
|
POST
|
Hello, Could someone explain to me when will QueryTask use POST request and when it will use Proxy? I have two application, In one application when I use a complex buffered geometry to query it uses the proxy as expected and from documentation here. However, the second application does a POST request directly, when I use the same geometry. Both the application are intranet applications, hosted on the same web server and accessing services from same GIS Server. I am using js version 3.13. The first application is a using legacy style while the other is AMD. Would this make a difference? Any help is appreciated.
... View more
04-28-2017
08:29 AM
|
0
|
0
|
618
|
POST
|
In 4.x you would need to use the source property of the BasemapGallery to achieve this. Its a starting point where you can look into. BasemapGallery | API Reference | ArcGIS API for JavaScript 4.3 There are two types of source you can provide to the BasemapGallery. The LocalBasemapsSource is used to show custom basemaps only. In case of ESRI Basemaps, the widget, get the list from portal (PortalBasemapsSource). You might have to use that object to manipulate it. There are 2 ways to do it. You can either use the basemaps Collection itself or use the filterFunction to filter the unwanted basemaps.
... View more
04-13-2017
10:43 AM
|
1
|
0
|
686
|
POST
|
If you look at the dojo documentation, the declarative style works only when you are using parser.parse(). Without which the TabContainer will not be parsed. Declarative refers to using the dojo/parser to read the DOM and parse out nodes that have been decorated with special attributes as well as interpreting certain <script> tags to extend the behavior of widgets. Using Declarative Syntax - Dojo Toolkit Tutorial Regarding the conflict you are facing with Measure, I have not seen it earlier. I shall try to create a sample and check it out.
... View more
04-11-2017
11:50 AM
|
1
|
1
|
992
|
POST
|
There are few issues you would need to address. The reason the TabContainer is not visible because, you are using the declarative method to add the Tab, but have set the parseonLoad to false. You can either set to true or user parser.parse(); second you need to add the TabContainer and ContentPane to the require so that all the necessary js files are downloaded to the client. Edit fiddle - JSFiddle made some change to the fiddler and you can see this working. Once, you have these things the TabContainer will show up properly. But, You will not see the attribute table as the height of the TabContainer is calculated as 0px. It happens because, at the time of initialization you are setting the height of the bottom panel to 0px. Now when you expand the bottom panel, you are using the jQuery to do it. it will not raise event or let the TabContainer know that the size has changed. So you would have to write code to resize the TabContainer and the FeatureTable. Hope this was helpful.
... View more
04-11-2017
09:01 AM
|
1
|
3
|
992
|
POST
|
I don't see the part where you are trying to add your Basemap to the BasemapGallery. Below is the documentation for source in BasemapsGallery The source for basemaps that the widget will display. This property can be autocast with an array or Collection of Basemaps, a Portal instance, or a URL to a portal instance. The default source is a PortalBasemapsSource that points to the default portal instance set in esriConfig.portalUrl. You need to create an instance of LocalBasemapsSource, and set the source property of the BasemapGallery. That will clear all the protal basemaps and only your custom basemap will be available. var localSource = new LocalBasemapsSource({
basemaps : [stamen]
})
var basemapGallery = new BasemapGallery({
view: view,
container: document.createElement("div"),
source: localSource
});
... View more
04-10-2017
09:02 AM
|
2
|
1
|
3051
|
POST
|
No problem, Don't forget to mark the question as answered.
... View more
04-10-2017
06:30 AM
|
0
|
0
|
560
|
POST
|
I understand that, I just shared the Points link just as a example that, Z and M values are available in 4.x version. You could use the paths to get the m values, but then you would be working with array objects. Another approach would be to get Points from the Polyline object using the "getPoint" method. Polyline | API Reference | ArcGIS API for JavaScript 4.3
... View more
04-10-2017
06:17 AM
|
0
|
0
|
627
|
Title | Kudos | Posted |
---|---|---|
1 | 03-24-2017 07:15 AM | |
1 | 09-13-2016 06:27 AM | |
1 | 05-21-2015 08:06 AM | |
1 | 12-16-2015 05:43 AM | |
1 | 07-20-2015 09:33 AM |
Online Status |
Offline
|
Date Last Visited |
2 weeks ago
|