Last active
December 31, 2015 18:39
-
-
Save cincodenada/8027966 to your computer and use it in GitHub Desktop.
For this Reddit thread: http://www.reddit.com/r/Favors/comments/1t6i0c/request_could_somebody_please_make_me_a_radius/ A bookmarklet that adds a text box to specify minutes for the ESRI Driving Distance mapper: http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/gmaps/samples/geoprocessor/gp_servicearea.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){GEvent.clearListeners(gmap,"click");document.getElementsByTagName('input')[0].insertAdjacentHTML('afterend','Drive Times:<input id="minutes"style="width:5em"type="text"value="5 15"/>(in minutes,separate multiple times with spaces)');GEvent.addListener(gmap,"click",function(marker,point){if(!marker){mapExtension.removeFromMap(gOverlays);var frslayer=new esri.arcgis.gmaps.FeatureSet();var feature=new esri.arcgis.gmaps.Feature();feature.geometry=point;frslayer.features=[feature];var drivetimes=document.getElementById('minutes').value;var params={"Input_Location":frslayer,"Drive_Times":drivetimes};driveTimeTask.execute(params,false,addResults);}});})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
GEvent.clearListeners(gmap, "click"); | |
document.getElementsByTagName('input')[0].insertAdjacentHTML('afterend','Drive Times: <input id="minutes" style="width:5em" type="text" value="5 15"/> (in minutes, separate multiple times with spaces)'); | |
GEvent.addListener(gmap, "click", function(marker, point) { | |
if(!marker){ | |
mapExtension.removeFromMap(gOverlays); | |
var frslayer = new esri.arcgis.gmaps.FeatureSet(); | |
var feature = new esri.arcgis.gmaps.Feature(); | |
feature.geometry = point; | |
frslayer.features = [ feature ]; | |
var drivetimes = document.getElementById('minutes').value; | |
var params = { "Input_Location": frslayer, "Drive_Times": drivetimes }; | |
driveTimeTask.execute(params,false, addResults); | |
} | |
}); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment