Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6059139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:40:38+00:00 2026-05-23T08:40:38+00:00

I am taking marker details from a database. The code is app.entries[id].data = {‘id’:

  • 0

I am taking marker details from a database.
The code is

app.entries[id].data = {'id': id, 'map': entry[1].innerHTML,'type_id':

entry[2].innerHTML,'name': entry[3].innerHTML,'descript':  entry[4].innerHTML, 'parish':

entry[5].innerHTML,'zip': entry[6].innerHTML, 'url': entry[7].innerHTML, 'lng':

entry[8].innerHTML,'lat':entry[9].innerHTML,'tags':entry[10].innerHTML,'img': 

entry[11].innerHTML,'imgs':entry[12].innerHTML};

app.entries[id].data.imgHTML = (app.entries[id].data.img == "") ? "" : 

fill_template(app.entries[id].data,app.infoWindowImageHTML);

var str = fill_template(app.entries[id].data,app.searchRowHTML);

html.push(str);

if (app.entries[id].data.lat != 0 || app.entries[id].data.lng != 0) {

   var point = new GLatLng(app.entries[id].data.lat,app.entries[id].data.lng);

   var m = new GMarker(point,{draggable: true});

   GEvent.addListener(m, "dragstart", function() {

          // map.closeInfoWindow();

      var latlngold = m.getLatLng();

  });

   GEvent.addListener(m, "dragend", function() {

var m = new GMarker(point,{draggable: true});

 m.entry_id = id;
 var p=m.entry_id;

    var latlngnew = m.getLatLng();

     alert(latlngnew);

     //m.setLatLng(new GLatLng(latlng));

     editentry1(latlngnew,p);

   });
 }

The dragend and dragstart function always takes the last marker’s details not the details of dragging marker..

function editentry1(latlngnew,p){

     var newlat=latlngnew.lat();

 var newlng=latlngnew.lng();

     var d = new Date();

var dv = d.valueOf();

var url = "<?php echo $g['appPath']; ?>admin/editPoint.php?d="+dv+"&

newlat=”+newlat+”newlng=”+newlng+”&p=”+p;

 var s = $('mapStatus');

s.innerHTML = “EDiting Point…”;

s.show();

new Ajax.Request(url, {

  method: 'get',

  onSuccess: editEntryReturn,

  onFailure: requestFailed

});

}

editPoint.php

require(“createThumb.php”);

$newlng = $_GET[‘newlng’];

$newlat = $_GET['newlat'];

$p=$_GET['p'];

$q = “UPDATE entry SET lat = ‘$newlat’, lng = ‘$newlng’ WHERE id=’$p’;”;

  $r = updateBatch($q);

}
?>
but the position of the marker doesn’t changes

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:40:39+00:00Added an answer on May 23, 2026 at 8:40 am

    Wrap your marker creation code in a function. This will create a closure in which the drag callbacks can find the appropriate marker object:

    function createMarker (point)
    {
        var m = new GMarker(point,{draggable: true});
    
        GEvent.addListener(m, "dragstart", function() {
            var latlngold = m.getLatLng();
        });
    
        GEvent.addListener(m, "dragend", function() {
            var latlngnew = m.getLatLng();
            editentry1(latlngold,latlngnew);
        });
    
        return m;
    }
    

    Call this from inside your if statement after getting the point:

    if (app.entries[id].data.lat != 0 || app.entries[id].data.lng != 0) 
    {
        var point = new GLatLng(app.entries[id].data.lat,app.entries[id].data.lng);
        map.addOverlay(createMarker (point));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Taking over some code from my predecessor and I found a query that uses
When taking a database from a relatively un-normalized form and normalizing it, what, if
In the below php code, am fetching the list of items bought from database.
Taking advice from this post , I purchased a copy of 'The C Programming
Taking the jQuery framework for example, if you run code like this: $(document).ready(function init()
I have a data set representing data from a log file which shows users
I'm trying to create a validator for my models: But taking the example from
Is it possible to determine the pixel co-ordinates of a given marker, taking into
Taking a peek into the information_schema database and peeking at the metadata for one
I have this code to show an AlertDialog when taping on a marker: public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.