Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

add marker directly on the map #1

Open
hvorragend opened this issue Aug 18, 2011 · 0 comments
Open

add marker directly on the map #1

hvorragend opened this issue Aug 18, 2011 · 0 comments

Comments

@hvorragend
Copy link
Member

here is an example, where the person saved a position localy on the browser (no interaction with a server),

on a click listener, like in this sample
[code]

<script type="text/javascript">

    function initialize() {

        if (GBrowserIsCompatible()) {

            var map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng(37.4419, -122.1419), 13);
            GEvent.addListener(map, "click", function() {

                alert("You clicked the map.");

            alert(map.getCenter().lat()+"-"+ map.getCenter().lng());

do ajax call to save point

});

}

}
</script>code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant