POST
|
var infoTemplate = new InfoTemplate(); var theid=1; graphic.setAttributes({"Name":"arrow","id":theid}); map.graphics.on("mouse-over", function(e){ //get the associated node info when the graphic is clicked alert(graphic.getContent()); }); I used a variable theId so you could increment or whatever. The alert is annoying, you can load a popup or something (a <div> that floats). if you click it, you get a popup
... View more
09-17-2014
12:47 PM
|
1
|
5
|
649
|
POST
|
If you put it in an external file you will not have access to the libraries or variables (map) in your init.js because of how Require.js works. The require(); is wrapping all the libraries and files in to a big function. Everything you do with them needs to be in the function. Maybe look at require.js examples for how to do this.
... View more
09-17-2014
12:32 PM
|
0
|
2
|
1210
|
POST
|
Use map.removeLayer(). In each buttons function, before you add a layer, check to see if the other layers are on and turn them off if they are. then load your layer for the button. if(map.hasLayer(countries)){ map.removeLayer(countries); countriesABC = new L.esri.featureLayer(featureURL-ABC, { style: getStyle, onEachFeature: onEachFeature,where: "type like"+"'"+buttonType.value+"'" }).addTo(map); } else {alert("aint got it");}
... View more
09-15-2014
12:10 PM
|
0
|
1
|
656
|
POST
|
I think there is something wrong with the e.target - it is an object and you need to pass and ID to the resetStyle() method. I added var countries; as the first line after the <script> tag. Delete the var in the onclick button function. Then where you have resetStyle(), I put this instead: countries.setStyle(getStyle()); Works. Code is as simple as ResetStyle() because I am just recalling your original style function.
... View more
09-15-2014
10:27 AM
|
0
|
3
|
656
|
POST
|
You have the reference to ColorPalette so the textbox probably uses the dojo widget. You could hide a <div> with the colorpalette widget, then on an event (edit a marker) it becomes visible and the color chosen updates the graphic. dijit.ColorPalette — The Dojo Toolkit - Reference Guide
... View more
09-15-2014
09:39 AM
|
0
|
3
|
461
|
POST
|
Loading the full layer is really slow on my machine. Preloading it is not making setWhere() and faster than if you just load the layer with where option onclick. I think loading using where is faster by a lot.
... View more
09-15-2014
08:16 AM
|
0
|
5
|
656
|
POST
|
Don't preload the layer. Load the basemap then add the layer using the where option - NOT the setWhere() method. $('#NSM').click(function() { var buttonType = document.getElementById('NSM'); var countries = new L.esri.featureLayer(featureURL, { style: getStyle, onEachFeature: onEachFeature, where: "type like"+"'"+buttonType.value+"'" }).addTo(map); }); If you will have lots of buttons, then make a function loadLayer() and pass the buttontype value. then you only need to add the code for the layer once.
... View more
09-15-2014
08:14 AM
|
0
|
0
|
654
|
POST
|
I got the same error. It was because I was not running the sample on a server, but from my desktop. You have to run the code from a webserver or it will not work. Could that be what is happening when you run it? I ran it from my server and it worked perfect. Had the countries and when I clicked them they turned red and data was on the right side of screen.
... View more
09-15-2014
07:29 AM
|
0
|
8
|
1175
|
POST
|
Looks like you can configure a geocoder to use alternate names. ArcGIS Help 10.1 If you publish this as the service you should be able to do what you need.
... View more
09-12-2014
03:15 PM
|
0
|
1
|
310
|
POST
|
got it. Here is my code. No Jquery. <!DOCTYPE html> <html> <head> <title>NSM</title> <!-- Load Leaflet from CDN--> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> <!-- Load Esri Leaflet from CDN --> <script src="http://cdn-geoweb.s3.amazonaws.com/esri-leaflet/0.0.1-beta.5/esri-leaflet.js"></script> <style> html, body, #map { width : 100%; height : 100%; } </style> </head> <body> <button onclick="NSM()">NSM</button> <div id="map"></div> <script> var you; //var map = L.map('map'); var map = L.map('map').setView([35.10418,-106.62987], 13); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png',{opacity:.4}).addTo(map); map.locate({watch:true, setView: false ,maxZoom: 16,enableHighAccuracy:true}); var nsm = new L.esri.FeatureLayer("http://dev.consciousglobalchange.org/arcgis/rest/services/MEP/noRelate_tester/FeatureServer/0"); var popupTemplate = "<h3>{type}</h3>"; nsm.bindPopup(function(feature){ return L.Util.template(popupTemplate, feature.properties) }); function NSM(){ nsm.setWhere("type like "+ "'NSM'"); nsm.addTo(map); } </script> </body> </html>
... View more
09-12-2014
12:58 PM
|
0
|
10
|
1175
|
POST
|
the field is type and the value is NSM. I got that error when I had NSM wrapped in double quotes when I type like 'NSM' I get the results as expected. you can use = too but has to be single quotes around NSM.
... View more
09-12-2014
12:43 PM
|
0
|
0
|
1173
|
POST
|
try setWhere(" type like 'nsm' "). ArcGIS REST Services Directory Login | Get Token Home > services > MEP > noRelate_tester (FeatureServer) > MEP_global_data.DBO.test_bdry > query Help | API Reference Query: MEP_global_data.DBO.test_bdry (ID: 0) Where: Object IDs: Time: Input Geometry: Geometry Type: Envelope Point Polyline Polygon Multipoint Input Spatial Reference: Spatial Relationship: Intersects Contains Crosses Envelope Intersects Index Intersects Overlaps Touches Within Relation Relation: Out Fields: Return Geometry: True False Max Allowable Offset: Geometry Precision: Output Spatial Reference: Geodatabase Version Name: Return IDs Only: True False Return Count Only: True False Order By Fields: Group By Fields (ForStatistics): Output Statistics: ReturnZ: True False ReturnM: True False Format: HTML JSON AMF # records: 6 type: NSM Polygon: [-1.05925448094E7, 6331610.610799998] , [-1.05925143079E7, 6337259.6477999985] , [-1.05923596851E7, 6339015.385300003] more... [-1.74327857678E7, 1.1523017382700004E7] , [-1.74324155192E7, 1.15212753389E7] , [-1.74266945879E7, 1.1507461465899996E7] more... [-1.70654633969E7, 7965857.698700003] , [-1.70644136541E7, 7967666.887500003] , [-1.70635779787E7, 7968250.298199996] more... [-1.91074667251E7, 9277683.944799997] , [-1.91073749979E7, 9276497.047700003] , [-1.91068790695E7, 9273703.769900002] more... [-1.4875929794599999E7, 7612574.983099997] , [-1.4875929794599999E7, 7613688.5315999985] , [-1.4873456720800001E7, 7628072.728600003] more... [-1.51547280122E7, 8013438.626999997] , [-1.5154136794300001E7, 8014083.521700002] , [-1.51351838718E7, 8009271.293399997] more... [-1.8491374124E7, 8490460.355300002] , [-1.84912484443E7, 8489146.592200004] , [-1.84870155207E7, 8473950.735399999] more... [-1.5023646974E7, 8052052.3552] , [-1.5023307227E7, 8053469.133299999] , [-1.5022131804499999E7, 8053527.569499999] more...
... View more
09-12-2014
11:59 AM
|
0
|
2
|
1173
|
POST
|
and the country value is in a field named type? What does the data table look like? what is the field holding the country?
... View more
09-12-2014
11:01 AM
|
0
|
4
|
1173
|
POST
|
the error says you have no field named NSM. Is there a property named NSM in the data? What does the HTML for the button look like?
... View more
09-12-2014
10:57 AM
|
0
|
0
|
1173
|
POST
|
If he is using C# it should require ESRI.ArcGIS.Geodatabase ESRI.ArcGIS.Geometry This is for 9.3 but should be able to find for 10.x too. How to execute spatial queries Good luck.
... View more
09-12-2014
10:48 AM
|
0
|
1
|
383
|
Title | Kudos | Posted |
---|---|---|
1 | 09-18-2014 01:38 PM | |
1 | 12-01-2014 01:37 PM | |
1 | 09-08-2014 03:32 PM | |
1 | 09-17-2014 12:47 PM | |
1 | 11-17-2014 07:42 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|