Well finally I could not use dragstart and dragend events, since I set "draggable" to false and it disabled those events.
To get the result I wanted, I used the 'mousemove' event on the map, putting the current coordinates in a variable. Then I added a 'mousedown' DomEvent on the map's div, getting the current coordinates that I just got from the 'mousemove'. Finally, I added a 'mouseup' DomEvent on the map's div getting the final coordinates. That wasn't so hard after all! :) On 17 août, 18:56, Chad Killingsworth <[email protected]> wrote: > I would use 2 separate mouse click events to generate the coordinates. > Single clicks don't change the map state by default and like other > mouse events contain the latLng data of the click. > > But to your specific question, there isn't anything built into the API > to handle this type of action directly. > > Chad Killingsworth > > On Aug 17, 12:19 pm, darkmalow <[email protected]> wrote: > > > Hi all :) > > > I'm still pretty new to the Google API but so far it's working great! > > But I would like to know if it's possible to do something. > > > I'm in the process of making a "coordinates picker" control, which is > > pretty simple in the case of a simple click on the map. > > > But there is a second functionnality of that picker that would allow > > the user to draw with its mouse a rectangle, giving the top left anf > > bottom right coordinates at the end. > > > How could I achieve that? I thought about using dragstart and dragend > > events on the Map, but I don,t want to map to scroll. Also, there is > > maybe already a solution integrated in the API which would do that, > > but then, I don't know what it would be! > > > So thanks a lot for your help, I'm waiting for your tips! :) > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
