|
POST
|
Tried with that, Still the same, Only 1st record is loaded and that is the one shown for all points in infowindow
... View more
06-21-2017
02:09 PM
|
0
|
5
|
2207
|
|
POST
|
//data from sql works fine, it binds to infowindow, but same data for all points, I think i'm missing something in the bold selected bottom lines var map; require([ "esri/map", "esri/dijit/Scalebar", "esri/InfoTemplate", "esri/symbols/SimpleLineSymbol", "esri/graphic", "esri/symbols/SimpleMarkerSymbol", "esri/Color", "dojo/on", "dojo/dom", "esri/geometry/Point", "esri/dijit/Search", "dojo/domReady!" ], function ( Map, Scalebar, InfoTemplate, SimpleLineSymbol, Graphic, SimpleMarkerSymbol, Color, on, dom, Point, Search ) { var markers = JSON.parse('<%=ConvertDataTabletoString() %>'); map = new Map("map", { basemap: "osm", center: [-120.7077, 47.2601], zoom: 7 }); var scalebar = new Scalebar({ map: map, // "dual" displays both miles and kilometers // "english" is the default, which displays miles // use "metric" for kilometers scalebarUnit: "dual" }); var search = new Search({ map: map }, "City"); search.startup(); var infoTemplate = new InfoTemplate(); infoTemplate.setTitle("Population in "); infoTemplate.setContent("<b>2007<br/>" ); 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; } map.on("load", addQueryResult); function addQueryResult() { for (i = 0; i < markers.length; i++) { var data = markers var lat = data.latitude; var long = data.longitude; var green = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 11, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([0, 128, 0]),2)); var yellow = new SimpleMarkerSymbol(SimpleMarkerSymbol.STYLE_CIRCLE, 11, new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([255, 255, 0]), 2)); var pt = new Point(long, lat); var graphic = new Graphic(); if (data.PermitStatus == 'Active') { var graphic = Graphic(pt, green); } else { var graphic = Graphic(pt, yellow); } map.graphics.add(graphic); map.on("click", Pointdata); function Pointdata(evt) { if (evt.graphic) { var latitude = evt.mapPoint.getLatitude(); var longitude = evt.mapPoint.getLongitude(); map.infoWindow.setTitle("FacilityDetails"); map.infoWindow.setContent(select city, industry from location//example query// ); map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint)); } } } } });thejus kambi@
... View more
06-21-2017
01:16 PM
|
0
|
8
|
2709
|
|
POST
|
May be you are using visual studio 2017, try using 2015
... View more
06-20-2017
10:06 AM
|
0
|
1
|
966
|
|
POST
|
All sql data converted to json from below code(posted above) and called at client side everytime page accessed or loaded, with the client side line var markers = JSON.parse('<%=ConvertDataTabletoString() %>'); ConvertDataTabletoString is function called everytime, there are 100's recorded loaded in to json function System.Web.Script.Serialization.JavaScriptSerializer serializer = newSystem.Web.Script.Serialization.JavaScriptSerializer(); List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>(); Dictionary<string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary<string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } return serializer.Serialize(rows); }
... View more
06-20-2017
09:46 AM
|
0
|
8
|
1974
|
|
POST
|
I added this line in client side var markers = JSON.parse('<%=ConvertDataTabletoString() %>'); convertdataatble tostring in backend i have written c# ccoding, I have posted above, and it is called everytime page loads
... View more
06-20-2017
09:14 AM
|
0
|
2
|
2249
|
|
POST
|
As per in the image, i need to show the colored circles on map, I was been stuck with this json from few days, any sample or example will be appreciated. Thank you
... View more
06-20-2017
09:10 AM
|
0
|
10
|
1974
|
|
POST
|
converted that into json, written in backend, in json all data is succesfully loaded in data table dt System.Web.Script.Serialization.JavaScriptSerializer serializer = newSystem.Web.Script.Serialization.JavaScriptSerializer(); List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>(); Dictionary<string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary<string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } return serializer.Serialize(rows); }
... View more
06-20-2017
08:59 AM
|
0
|
4
|
2249
|
|
POST
|
I have written that in backend c# using (SqlCommand cmd = new SqlCommand("SearchByRadiusMap", con)) { cmd.CommandType = CommandType.StoredProcedure; SqlParameter distancevalue = new SqlParameter("@distance", distance); cmd.Parameters.Add(distancevalue); SqlParameter latitudevalue = new SqlParameter("@lat", latitude); cmd.Parameters.Add(latitudevalue); SqlParameter longitudevalue = new SqlParameter("@long", longitude); cmd.Parameters.Add(longitudevalue); con.Open(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); List<Dictionary<string, object>> rows = new List<Dictionary<string, object>>(); Dictionary<string, object> row; foreach (DataRow dr in dt.Rows) { row = new Dictionary<string, object>(); foreach (DataColumn col in dt.Columns) { row.Add(col.ColumnName, dr[col]); } rows.Add(row); } return serializer.Serialize(rows); }
... View more
06-20-2017
08:51 AM
|
0
|
12
|
1974
|
|
POST
|
var map; require([ "esri/map", "esri/symbols/SimpleLineSymbol", "esri/graphic", "esri/symbols/SimpleMarkerSymbol", "esri/Color", "dojo/on", "dojo/dom", "esri/geometry/Point", "dojo/domReady!" ], function ( Map, SimpleLineSymbol, Graphic, SimpleMarkerSymbol, Color, on, dom, Point ) { var markers = JSON.parse('<%=ConvertDataTabletoString() %>'); map = new Map("map", { basemap: "osm", center: [-122.9007, 47.0379], zoom: 9 //scale }); 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; //map.infoWindow.setTitle("Coordinates"); //map.infoWindow.setContent( // "lat/lon : " + latitude.toFixed(2) + ", " + longitude.toFixed(2) + // "<br>screen x/y : " + evt.screenPoint.x + ", " + evt.screenPoint.y //); // map.infoWindow.show(evt.mapPoint, map.getInfoWindowAnchor(evt.screenPoint)); } });
... View more
06-19-2017
06:36 PM
|
0
|
16
|
4162
|
|
POST
|
taking XY values from textbox and loading nearby industries. How to diplay data from stored procedure. with colored circles require([ "esri/map", "dojo/domReady!" ], function ( Map ) { 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; } });
... View more
06-19-2017
03:04 PM
|
0
|
6
|
3259
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-22-2019 06:52 AM | |
| 1 | 08-27-2018 09:37 AM | |
| 1 | 08-20-2019 01:12 PM | |
| 1 | 12-18-2018 12:17 PM | |
| 1 | 03-28-2019 08:22 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-22-2024
08:32 PM
|