Well thats better than my widget
For the WebApp Builder, there's also the Coordinate Conversion widget from the Solutions team that might be useful some people reading this geonet question. This widget converts input coordinates to various notation formats like MGRS for example. https://github.com/Esri/solutions-webappbuilder-widgets/tree/dev/CoordinateConversion
To play with it, go to http://esri.github.io/solutions-webappbuilder-widgets/ - "Coordinate Conversion" is the third widget.
In case you use the webappbuilder, I created this: ArcGIS Web Application
https://community.esri.com/docs/DOC-3262
I created this some time ago: http://jsfiddle.net/timw1984/ahnmv8gy/embedded/result/
https://community.esri.com/people/timw1984/blog/2014/08/18/javascript-api-location-widget
Hi,
Thanks for your feedback.
U can send it by email.
Thanks ya 😃
Regards,Nana
Nana,
My apologies for the late response. I do have a sample I can send. Do you want me to send it by email or another method? There is still some minor modifications that need to be done, but I think it will get you started.
hi Ian,
have you found the solution? Same like me now, want to develop tool for find coordinate like yours.. Can you help me how to code it?
Thanks,
Regards,
Nana 😃
/*jslint browser: true, nomen: true */ /*jshint dojo, jquery, nomen:false */ /*global jQuery */ (function ($) { "use strict"; // Matches DMS coordinates // http://regexpal.com/?flags=gim&regex=^(-?\d+(?:\.\d+)?)[°%3Ad]%3F\s%3F(%3F%3A(\d%2B(%3F%3A\.\d%2B)%3F)['�?�%3A]%3F\s%3F(%3F%3A(\d%2B(%3F%3A\.\d%2B)%3F)["�?�]%3F)%3F)%3F\s%3F([NSEW])%3F&input=40%3A26%3A46N%2C79%3A56%3A55W 40%3A26%3A46.302N 79%3A56%3A55.903W 40°26�?�47�?�N 79°58�?�36�?�W 40d 26�?� 47�?� N 79d 58�?� 36�?� W 40.446195N 79.948862W 40.446195%2C -79.948862 40° 26.7717%2C -79° 56.93172 var dmsRe = /^(-?\d+(?:\.\d+)?)[°:d]?\s?(?:(\d+(?:\.\d+)?)['�?�:]?\s?(?:(\d+(?:\.\d+)?)["�?�]?)?)?\s?([NSEW])?/i; // Results of match will be [full coords string, Degrees, minutes (if any), seconds (if any), hemisphere (if any)] // E.g., ["40:26:46.302N", "40", "26", "46.302", "N"] // E.g., ["40.446195N", "40.446195", undefined, undefined, "N"] /** Parses a Degrees Minutes Seconds string into a Decimal Degrees number. * @param {string} dmsStr A string containing a coordinate in either DMS or DD format. * @return {Number} If dmsStr is a valid coordinate string, the value in decimal degrees will be returned. Otherwise NaN will be returned. */ function parseDms(dmsStr) { var output = NaN, dmsMatch, degrees, minutes, seconds, hemisphere; dmsMatch = dmsRe.exec(dmsStr); if (dmsMatch) { degrees = Number(dmsMatch[1]); minutes = typeof (dmsMatch[2]) !== "undefined" ? Number(dmsMatch[2]) / 60 : 0; seconds = typeof (dmsMatch[3]) !== "undefined" ? Number(dmsMatch[3]) / 3600 : 0; hemisphere = dmsMatch[4] || null; if (hemisphere !== null && /[SW]/i.test(hemisphere)) { degrees = Math.abs(degrees) * -1; } if (degrees < 0) { output = degrees - minutes - seconds; } else { output = degrees + minutes + seconds; } } return output; } // Add coordinate validation method to jQuery validator. if (typeof ($.validator) !== "undefined") { $.validator.addMethod("coordinate", function (value, element) { return this.optional(element) || dmsRe.test(value); }, "Please enter a Decimal Degree or DMS value."); } $.parseDms = parseDms; }(jQuery));
function zoomToPoint (x,y) { var point = webMercatorUtils.geographicToWebMercator(new Point(x, y, map.spatialReference)); map.centerAndZoom(point,15); var tempPoint = map.graphics.add(new Graphic(point, config.gotoPoint)); window.setTimeout(function(){map.graphics.remove(tempPoint);},3000); // on.once(map, "click", function(){ // map.graphics.remove(tempPoint); // }); }
You might find these samples useful:https://developers.arcgis.com/javascript/jssamples/util_project.htmlhttps://developers.arcgis.com/javascript/jssamples/util_coordinate_converter.html
...coordinates tool ... Are there any samples out there or does anyone have any ideas?
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.