Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5841481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:53:45+00:00 2026-05-22T11:53:45+00:00

One of the actions a user can perform using the ESRI Flex Viewer application

  • 0

One of the actions a user can perform using the ESRI Flex Viewer application is to draw a shape on a map (e.g. a line). Once the user is finished drawing the line, they will double-click the mouse which fires a DrawEvent.DRAW_END event. When this is fired, the line is measured using a call to an API function geometryService.project([geometryObject], spatialReference);.

I want to be able to call this function after a MouseEvent.MOUSE_MOVE event in order to measure the line on the fly, instead of only after the DRAW_END event. Unfortunately, the only two DrawEvents that get dispatched are the DrawEvent.DRAW_START and DrawEvent.DRAW_END. These ESRI classes are compiled classes, so I cannot make any changes to them.

Is there a way to add an eventListener to a MOUSE_MOVE event that can grab the current geometry of the line that is being drawn and call my API function to measure on the fly?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:53:46+00:00Added an answer on May 22, 2026 at 11:53 am

    I found a solution to this problem by circumventing the geometry service altogether and building a solution of my own. There is a great site that implements the Vincenty algorithm for measuring the distance between two coordinates. This is a very accurate approximation algorithm (within .5mm on Vincenty’s earth ellipsoid), and is meant to be very efficient so that it can be used frequently (e.g. after a mouse moves).

    Here’s the basic steps to implement this:

    1. Add an event listener to the map that listens for a mouse click
    2. Once the mouse is clicked, convert the coordinates of the location of the click on the screen to map coordinates and add a listener to watch for a mouse move event
    3. When the mouse moves, grab the coordinates of the mouse (as in step 2) and perform the Vincenty calculation. Create a custom tooltip on the map and add the Vincenty result to the tooltip text.
    4. Upon double-click, send the result to the Geometry service and remove the tooltip from the map
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is to be an application-agnostic question, but one I'd like to get a
I am using SimpleModal in jQuery, and I have one confirm dialog. If the
I have an application that requires the user to reenter their password between 15
I have a form on an HTML page with multiple submit buttons that perform
I am using the built-in forms authentication that comes with asp.net mvc. I added
I need to re-write a businesss InfoPath / SharePoint application that has a fair
I have been trying to design the Undo/Redo functionality in one of my app
Currently I am working on one form which contains 2 buttons. Clicking on 1
I have an idea for a new desktop environment that involves a radically different
I have a simple form in Access. There are number of textfields. There is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.