0

Gmarker - How can I get the lat and lng of Gmarker?

asked 2013-05-21 22:02:52 +0800

ArkonJavia gravatar image ArkonJavia
18

Hi everyone, I trying get the lat/lng from Gmarker, but every time its return the same value. I just can get the values from Gmaps, but dont' solve my problem. The alerts is for tests. I need the lat and lng from gmarker when the user drop it. The code:

<gmaps id="map" use="gmaps.GMapExt"
                    width="100%" zoom="14" height="300px" showSmallCtrl="true"
                    lat="@{gm.lat}" lng="@{gm.lng}">
                    <gmarker id="gm" draggable="true" >
                        <attribute name="onMapDrop">
                             <![CDATA[
                            alert("gMarker -\n\nLat:" + self.lat + "\nLng:" +self.lng);
                        ]]>
                        </attribute>
                    </gmarker>
                </gmaps>
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-06-04 02:32:16 +0800

RichardL gravatar image RichardL
768 4

Is this what you want (put it in you composer)?

/**
     * Pan to marker position on the drop of a marker.
     * @param event
     * @throws InterruptedException
     */
    public void onMapDrop$gmap(MapDropEvent event) throws InterruptedException {
        lat = event.getLat();
        lng = event.getLng();
        gmap.panTo(lat, lng);

    }
link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-05-21 22:02:52 +0800

Seen: 16 times

Last updated: Jun 04 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More