[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 979
  • Last Modified:

asp.net google map marker coordinates

I need to display a google map on an asp.net web page

1) when the page loads the map has to be show with a MARKER and the user can move the marker and it shows the coordinates in textboxes (latitiude and longitude)
when the marker is moved.

Can the code be shown for that or any URL which exactly shows what I am looking for.

thanks in advance.
2 Solutions
Molnar IstvánHelpDesk / ProgrammerCommented:
you can use http://en.googlemaps.subgurim.net/ , it's easy to use and its free.
Use this javascript functions for movable markers

function placeMarker() {
  var listener = GEvent.addListener(map, "click", function(overlay, latlng) {
    if (latlng) {
      var color = getColor(true);
      var marker = new GMarker(latlng, {icon: getIcon(color), draggable: true});
      var cells = addFeatureEntry("Placemark " + (++markerCounter_), color);
      updateMarker(marker, cells);
      GEvent.addListener(marker, "dragend", function() {
        updateMarker(marker, cells);
      GEvent.addListener(marker, "click", function() {
        updateMarker(marker, cells, true);

function updateMarker(marker, cells, opt_changeColor) {
  if (opt_changeColor) {
    var color = getColor(true);
    cells.color.style.backgroundColor = color;
  var latlng = marker.getPoint();
  cells.desc.innerHTML = "(" + Math.round(latlng.y * 100) / 100 + ", " +
  Math.round(latlng.x * 100) / 100 + ")";

source : http://gmaps-samples.googlecode.com/svn/trunk/poly/mymapstoolbar.html

and use


to see lat/long on mousemove.
You can use these two solutions to get your desired solution.

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now