POST
|
Thanks Robert. That's excellent. I didn't know the name of the html element, "text" in this case, could be used. Thanks!
... View more
12-12-2016
11:22 AM
|
0
|
0
|
1206
|
POST
|
I'm using the sidebar example ArcGIS API for JavaScript Sandbox and I would like to place the legend widget inside of it. Is this possible? So far I have only been able to place it at a default location. It would be great if I could place it inside of a div of my choosing. Thanks Chuck
... View more
12-12-2016
10:32 AM
|
0
|
3
|
2240
|
POST
|
Hi All, I've got a page that uses a bootstrap layout and a 4.1 map as one of the elements of the page. One of the feature layers is using popup templates to display attributes and everything works fine at a large screen size, but when I change the size of the screen I'm noticing that where I click on the map is not where the popup thinks I'm clicking. I've been having to click below/south of the points to actually display a popup, and as I decrease the size of the screen the problem gets worse. If remove all of the other elements of the page and leave only the map, it works fine, and that includes leaving the references to bootstrap (below): <!--Bootstrap--> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <!--ESRI JavaScript API--> <link rel="stylesheet" href="https://js.arcgis.com/4.1/esri/css/main.css"> <link href="css/snap.css" rel="stylesheet" /> <!--jQuery--> <script src="http://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> <!--Bootstrap--> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <!--ESRI JavaScript API--> <script src="https://js.arcgis.com/4.1/"></script> <script src="js/snap_homepage_map.js"></script> But even if I put a header on the page it shifts or breaks the popup functionality. For a test, I rewrote the page in 3.18 and it didn't have the same problem, but the InfoTemplates and functionality are not as good for a mobile web page. Does anybody have an suggestions about how to resolve this problem for 4.1 inside of a bootstrap layout? I'd be glad to supply the full web page and script. Thanks, Chuck
... View more
11-23-2016
11:54 AM
|
0
|
0
|
964
|
POST
|
Thanks Robert, The workaround is helping. Thanks for the advice. I'll check back to see if there is any other information.
... View more
10-19-2016
09:04 AM
|
0
|
3
|
1882
|
POST
|
Hello All, I'm using the 4.1 sample and noticing that the map will not load when the Div is inside of another div. See the html below. It's basically the sample from Getting Started: Get started with MapView - Create a 2D map | ArcGIS API for JavaScript 4.1 Do I need to change something? This worked in earlier versions. <body> <div> <div> <h1>Stations Map</h1> </div> <div id="viewDiv"> </div> </div> </body> Thanks, Chuck
... View more
10-18-2016
01:42 PM
|
0
|
6
|
3673
|
POST
|
Hello, I built a map with several feature layers (points and lines) and a single graphics layer. When the graphics layer is empty I can easily click on the points and view attributes in the popup template. The popup template is set when the feature layer is declared and it all works as it should. The problem is when the graphics layer is populated and the graphic overlaps the feature layer points. Then the popup displays with a blank results because it's querying against a graphic that doesn't have attributes. I need to clear the graphics from the graphics layer in order to successfully view the popups again. I've read in this forum that the graphics layer is always on top. Is that true? If it is, what approach to I need to take to prevent a popup on a graphic in a graphics layer, but allow popups for feature layers? Thanks, Chuck
... View more
10-10-2016
09:48 AM
|
1
|
6
|
1933
|
POST
|
Is it possible to query a FeatureLayerView of a hosted feature service from AGS 10.22? The code below is not working: view.whenLayerView(featureLayerProjects).then(function (lyrView) { lyrView.watch("updating", function (val) { if (!val) { // wait for the layer view to finish updating view.on("click", function (evt) { var circle = new Circle({ center: evt.mapPoint, radius: 1000 }); console.log(circle); var query = new Query(); query.geometry = circle; query.spatialRelationship = "intersects"; lyrView.queryFeatures(query).then(function (results) { console.log(results); // prints the array of client-side graphics to the console }); }); } else { console.log('something else happened'); } }); }); The code above comes is modified from an example I found in the documentation here: FeatureLayerView | API Reference | ArcGIS API for JavaScript 4.0 When I don't pass a query to the queryFeatures() function all of the features in the featureSet are returned. When I do pass a query, I get an error in the console: Object {name: "QueryEngine", message: "Invalid query", details: undefined} " The larger problem I'm trying to solve is to click a point and get the attributes. I though it would be possible to use the FeatureLayerView client side and not send a query to the server, but I cannot find a way to do it. Is it because the server version is not new enough? Thanks, Chuck
... View more
07-12-2016
09:04 AM
|
1
|
0
|
1176
|
POST
|
Just found this: FAQs | ArcGIS API for JavaScript 4.0
... View more
07-11-2016
09:34 AM
|
1
|
0
|
1264
|
POST
|
Hi Robert, Thanks for providing that informaiton. Is there any link where people can see what is being developed for the next release of 4.0 and/or what the schedule is? Thanks, Chuck
... View more
07-11-2016
09:32 AM
|
0
|
1
|
1264
|
POST
|
Thanks for your help, but unfortunately, this approach is not working in 4.0 with a PopupTemplate. // CODE var wrpProjectsPopupTemplate = new PopupTemplate({ title: "{MapLayer}", content: setPopupTemplateContent() }); function setPopupTemplateContent(graphic) { try { var attr = graphic.attributes; -- getting error the graphic is undefined return attr; } catch (err) { return err.message; } } I may see if I can either get the graphic on a map click of the view or find an alternative the the PopupTemplate. Thanks
... View more
07-11-2016
08:39 AM
|
0
|
3
|
1264
|
POST
|
Is there a way to condition show fields in the content of a PopupTemplate? For example, if field 1 = "A", can I display field 2 and if field 1 = "B" can I display field 3?
... View more
07-08-2016
11:06 AM
|
0
|
6
|
3149
|
POST
|
No problem, the code is below: I sanitized the "domain" below but could provide that privately. // first layer does not work var cities0surl = "http://domain/arcgis/rest/services/Mapping/CitiesWebMap/MapServer/0"; var cities1surl = "http://domain/arcgis/rest/services/Mapping/CitiesWebMap/MapServer/1"; // This was displaying as 'undefined' - commented out, copied, pasted and changed 0 to 1 (below) //var cities0FeatureLayer = new FeatureLayer(cities0surl, { // id: "cities0FeatureLayer", // maxScale: 1000000, // minScale: 3000000, // outfields: ["AREANAME"], // visible: false //}); // this layer works with the same features that had been in layer 0, I modified the map service by adding // an artificial layer on top - and that now shows the 'undefined' label but I don't use it var cities1FeatureLayer = new FeatureLayer(cities1surl, { id: "cities1FeatureLayer", maxScale: 1000000, minScale: 3000000, outFields: ["AREANAME"], visible: false }); // adding to map //map.addLayer(cities0FeatureLayer); map.addLayer(cities1FeatureLayer); // LABELS //-----------------------------------------------------------------------------------------------------------------// // create a renderer for the states layer to override default symbology var labelColor = new Color("#000000"); // create a text symbol to define the style of labels var statesLabel = new TextSymbol().setColor(labelColor); statesLabel.setAlign(TextSymbol.ALIGN_START); statesLabel.font.setSize("0.8em"); statesLabel.font.setFamily("tahoma"); statesLabel.font.setWeight("BOLD"); var statesLabelRenderer = new SimpleRenderer(statesLabel); var labels = new LabelLayer({ id: "labels" }); // using the field named "AREANAME" //labels.addFeatureLayer(cities0FeatureLayer, statesLabelRenderer, "{AREANAME}"); labels.addFeatureLayer(cities1FeatureLayer, statesLabelRenderer, "{AREANAME}"); // add the label layer to the map map.addLayer(labels); //-----------------------------------------------------------------------------------------------------------------//
... View more
11-18-2015
10:34 AM
|
0
|
1
|
442
|
POST
|
While attempting to label a feature layer that has the 0 index of a dynamic map service, I was unable to get the labels to properly display. The displayed label was always "Undefined", but the feature layers at index 1,2, etc. worked just fine for the other layers within the map service. As a work-around, I added a dummy layer on top to take the zero index and changed my javascript side accordingly. The map service shows population centers that are filtered by different definition queries but no display scales are set on the mxd side. I did that in the js side. So its the same feature class, just restricted by different fields a few times. The display fields is the same for all of them. There was no difference between layer 0 and layer 1 in the service except for the definition query in the mxd, yet labels in the 0 layer were undefined and the labels in the 1 layer worked fine. Maybe this comment will potentially help somebody that runs into the same issue.
... View more
11-18-2015
09:51 AM
|
0
|
3
|
3493
|
POST
|
Thanks for the reply. If I'm unable to display the basemap without labels I'll probably create my own custom basemap service.
... View more
11-16-2015
01:16 PM
|
0
|
0
|
597
|
POST
|
Is it possible to turn off the labels of an ESRI basemap? The labels of one of the feature layers on my map are colliding with the basemap labels. Thanks
... View more
11-13-2015
01:07 PM
|
0
|
3
|
4400
|
Title | Kudos | Posted |
---|---|---|
1 | 08-08-2019 08:50 AM | |
1 | 02-05-2015 06:33 AM | |
1 | 01-24-2017 01:40 PM | |
1 | 10-10-2016 09:48 AM | |
1 | 07-12-2016 09:04 AM |
Online Status |
Offline
|
Date Last Visited |
01-30-2023
10:20 PM
|