Tag Info

Hot answers tagged

3

onExtentChange is an event that is run every time the user changes the extent in your map (you add a dojo listener for this event, which then runs the rest of your code) map.extent is the value of the current value of the view-extent in the map (which you would be saving everytime the onExtentChange event is fired and lastly map.setExtent is the function ...


2

I hate to answer my own question, but I've found a resolution. ESRI is releasing their JavaScript Web Optimizer, which will bundle and optimize everything into one file. That includes custom classes, Dojo itself, and only the required JavaScript API modules. I saw it at the Dev Summit, and it's pretty interesting.


2

One idea would be to hide the WMSLayer entirely if the map's extent is outside the layers "valid" extent. Based on this answer, one could listen to the map's extent-change event and check if the map's current extent is acceptable: map.on("extent-change", function () { // Check if map.extent is acceptable, otherwise hide the WMSLayer. if ...


2

When you're using the draw tools, use the draw-end event to get to the geometry that was just created. This is shown in a couple of samples: Add graphics to a map and Drawing tools. If you need your geometry in geographic coordinates (AKA wgs84 AKA lat/long), listen to the draw-complete event as the object your callback gets will have a geographicGeometry ...


2

I agree with @evv_gis in that, at least from my experience so far, there is little in the way of best practices for this relatively niche area of development. However, I do have some recommendations from my own experience. The ESRI API examples are an excellent source for learning techniques but don't base your development of any complex application on ...


2

So as I stated in my first comment, you need to add a listener for the zoom-end event. Inside of that listener, get the current map zoom level and use logic to change the picture marker symbol sizes. Here is a quick and dirty example: map.on('zoom-end', function() { var z = map.getZoom(); // GET THE CURRENT MAP ZOOM LEVEL //ADD LOGIC TO CHANGE ...


1

This will show you what the current basemap is <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--The viewport meta tag is used to improve the presentation and behavior of the samples on iOS devices--> <meta name="viewport" content="initial-scale=1, ...


1

This probably isn't the answer you want, but the Only solution is to do it by Hand. Not only are the API's very different, even the Languages and framework are very different. ActionScript might be a ECMAScript, but to run it as JavaScript, you'll have call JavaScript specific functions, and remove all the FLEX specific code. The UI's that you have built ...


1

Using the JS API, you have several different options: if the 'SHAPE.Area' field is exposed by the service you are working with, values can be retrieved as attributes of a graphic of interest. https://developers.arcgis.com/javascript/jsapi/graphic-amd.html#attributes the API also provides a utility method to calculate the geodesic area of an input ...


1

because the widget supports incorporating search results from more than one locator, you actually don't set the placeholder property on the widget itself. as per the documentation, you could specify some custom text for the default Esri World Geocoding service like this: var myGeocoder = { url: ...


1

Have you destroyed your previous TOC? I've found that the legend widget get's confused if you build a new one without first destroying the old one. The legend widget has a destroy method, I'm not sure if the TOC does as well. Try completely removing the old TOC before building a new one. Good Luck. It's essentially something like this. But as I said ...


1

When you're using new HomeButton you are actually accidentally invoking new dijit/layout/BorderContainer instead because your require modules aren't lining up with your main function arguments. Try using this: require([ "esri/map", "esri/dijit/OverviewMap", "dojo/parser", "dijit/layout/BorderContainer", "dijit/layout/ContentPane", ...


1

Eric Pimpler over at Geospatial Training Services compiled a copious list of articles on Dojo for Web Mapping for the AGS Javascript API 1. However, since it was stacked up in 2009, it might have some bad links and no-longer-relevant content. Also, remember that Dojo is a framework for much more than Web Mapping. Many of the common-sense (and some of the ...



Only top voted, non community-wiki answers of a minimum length are eligible