Select to view content in your preferred language

Evento no mapa obter latitude e longitude

2223
1
05-13-2016 07:57 PM
Valderli_JorgePiontekowski
Deactivated User

Estou utilizando ArcGIS API JavaScript 4.0 e estou tentando retornar com mapPoint a latitude e longitude a partir do mapa, mas única maneira que consegui foi com "click":

    view.on("click", function(evt) {

        // Get the coordinates of the click on the view

        var lat = (evt.mapPoint.latitude).toFixed(2);

        var lon = (evt.mapPoint.longitude).toFixed(2);

        dom.byId("info").innerHTML = lat + ", " + lon;

    });

Gostaria de saber se é possível fazer com evento ao passar o mouse (por exemplo: load, mosue-over, hover)?

obrigado

Tags (2)
0 Kudos
1 Reply
AdrianWelsh
MVP Honored Contributor

Hi Valderli,

From using Google Translate, I attempted to read this in English.

Can you not just user the "mouse-over" event in the JavaScript in place of the "click" event? Does this not do anything?

There is an example in here:

Feature layer hover | ArcGIS API for JavaScript

This one mentions the mouse-over event.

I found here:

Show info window on mouse hover | ArcGIS API for JavaScript

Information on mouse hovering.

I hope this helps.

0 Kudos