Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi for PHP/Library/Other    [ Add a report in this area ]  
Report #:  101424   Status: Closed
[ajaxCall] Google Maps component does not refresh in JS
Project:  HTML5 Builder Build #:  4.2.0.1617
Version:    4.0 Submitted By:   Eduardo Nunes
Report Type:  Minor failure / Design problem Date Reported:  11/30/2011 5:14:18 AM
Severity:    Infrequently encountered problem Last Updated: 9/5/2012 7:26:04 PM
Platform:    All platforms Internal Tracking #:   289050
Resolution: Fixed (Resolution Comments) Resolved in Build: : 5.0 RTM
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
I'm trying to refresh google map by using ajaxCall in my application but it does not refresh.

When i click in jtgrid, i'm trying to refresh google maps component.

I'm using
---------------
class Page4 extends Page
{
  public $Button1 = null;
  public $GoogleMap1 = null;
  function Button1JSClick($sender, $params)
  {
    ?>
    //begin js
    <?php
      echo $this->Button1->ajaxCall("mostramapa",array(), array("GoogleMap1"));
    ?>
    return false;
    //end
    <?php
  }

  function mostramapa($sender, $params)
  {
    $this->GoogleMap1->Address = 'Belo Horizonte, MG';
    //$this->GoogleMap1->dumpHeaderCode();
  }
}
---------------
Steps to Reproduce:
Drop a button on form
drop a google map component on the form


insert the code above in the OnClick event in javascript.
Workarounds
None
Attachment
Test_Googlemap.zip
Comments

Tomohiro Takahashi at 11/30/2011 6:25:05 PM -
Could you please attach simple sample project to reproduce your issue?

Eduardo Nunes at 12/1/2011 5:26:15 AM -
Follow sample project

Tomohiro Takahashi at 12/4/2011 6:48:30 PM -
In your case, you do not need to use ajax to change address of Google Map on WebBrowser.
So, could you please try my Steps as below?

1. create new RPCL form app
2. add GoogleMap and Button component on the form
3. change ButtonType property from btSubmit to btNormal
4. just add OnClick Javascript event for Button component as below
-----------------
class Unit1 extends Page
{
    public $GoogleMap1 = null;
    public $Button1 = null;
    function Button1JSClick($sender, $params)
    {
        ?>
        //begin js
        var map = new GMap2(document.getElementById('GoogleMap1_div'));
        var geocoder = new GClientGeocoder();
        var address="Belo Horizonte, MG";
        geocoder.getLatLng(address,
          function(point) {
            if(point) {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              //map.addOverlay(marker);
              marker.openInfoWindowHtml(address);
            }
          }
        );
        //end
        <?php
    }
}
-----------------

Eduardo Nunes at 12/5/2011 7:36:30 AM -
Ok, it's working fine.

Thank you

Eduardo Nunes at 1/10/2012 7:23:15 AM -
You can close this report

Thanks

Server Response from: ETNACODE01