简体   繁体   中英

Saving data lat/lng into db from google maps api?

I am using asp.net c# and google maps api. I want user can set route or markers on the map and I can save the points in the sql for showing them again.

There is some code @Chad Killingsworth wrote it for routing but how can I catch the lat/lng and write to db? polyline snap to road using google maps api v3 http://people.missouristate.edu/chadkillingsworth/mapsexamples/snaptoroad.htm

Or this is what I want but in php, how can I do that with asp.net? How can I know the points and record db?

http://vikku.info/programming/google-maps-v3/draggable-directions/saving-draggable-directions-saving-waypoints-google-directions-google-maps-v3.htm

you can fetch the value like this, then save the value.

google.maps.event.addListener(map, "click", function(event){

                var p = new google.maps.LatLng(event.latLng.lat(), event.latLng.lng());
                marker.setPosition(p);
                p.lng();
                p.lat();   

                });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM