APISignature bug? A Request

I think I may have found a bug in the ReplaceHTML function inside UWebGMaps.
We are not using this particular feature yet, but I ran across it when troubleshooting for Channel.

Here is the offending code....

function TWebGMaps.ReplaceHTML(HTML: string): string;
var
  LanguageCode: String;
begin
  Result := HTML;

  if ApiKey <> '' then
    Result  := ReplaceText(Result,'%apikey%','apikey=' + APIKey + '&')
  else if (APIClientID <> '') and (APISignature <> '') then
    Result  := ReplaceText(Result,'%apikey%','client=' + APIClientID + '&signature' + APISignature + '&')
  else
    Result  := ReplaceText(Result,'%apikey%', '');

I believe that piece of highlighted code should be &signature=' + APISignature +

If I am mistaken, I apologize, but all of Google's documentation suggests there should be an equal sign there, just like all the other Java parameters.
=====================================
Second, I have a feature request or two..

Would it be possible to configure the HTML_BLANK_PAGE constant as a feature?

In particular, the function TWebGMaps.Launch has the FWebBrowser.Navigate(HTML_BLANK_PAGE); line of code that causes us particular trouble with Google and validation of our calling "verified" web addresses. We need to set this to '0.0.0.0' to get our Google account to properly verify our calling web page. Not sure why, but About:Blank causes them some sort of issue.

Lastly,
Now that you are going to implement Channel in your component, it would be great if you could also slightly alter the ReplaceHTML function to not tie APISignature to APIClientID. With what I mentioned above, Google has a way to track the website you are calling from with the passed ClientID and ChannelID without requiring a Signature for things like serving up maps, and it would be great to just use your component as is, without modifying the HTML because we are not providing a signature for the initial map load. Since we are not providing the signature, your RpelaceHTML function also does not place the APIClientID into the HTML, so we are forced to do this...and the Channel manually.

Thanks for reading this and considering all possibilities. 

Hi,


- The issue with the APISignature property has been fixed.
The update will be available with the next release of TMS WebGMaps.

- We'll have to investigate if it's possible to allow custom values for the HTML_BLANK_PAGE constant as this is required for technical reasons.

Thank you for looking into this. I researched a bit more the "about:blank" situation I mentioned, and after talking to our other developer I found out that we use a WhiteList of approved web addresses on our Google ClientID site.
We must initialize the webbrowser to this approved address first, or all other requests do not properly approve with the Google whitelist.

It would be great if you could consider implementing a fix or feature in the following way to accommodate this.

UWebGMaps code:

========================================
function TWebGMaps.Launch:Boolean;
var
  aStream: TStream;
  HtmlFile: String;
begin
  Result := False;
  HtmlFile := InitHtmlFile;

  if FMapOptions.FPreloaderVisible then
  begin
    Preloader.Visible := True;
    (Preloader.Picture.Graphic as TGifImage).Animate := True;
    Application.ProcessMessages;
  end;

  try
    FWebBrowser.Navigate(HTML_BLANK_PAGE);

    if DefaultURL <> '' then
      (FWebBrowser.Document as IHTMLDocument2).URL := DefaultURL;

    while FWebBrowser.HandleAllocated and (FWebBrowser.ReadyState <> READYSTATE_COMPLETE) do
=============================

DefaultURL would be a property in the same place as default Lat/Long

Wanted to give an update on what was really going on here, because I realized that changing the constant was not really something you would or should even be considering. A solution like this seems like it would be more viable for you.
Currently, we have modified your source to work this way so we can properly access our Google maps account from the appropriate approved address.

Thanks

i noticed, that you are using "http://127.0.0.1" as the current value for HTML_BLANK_PAGE.
this causes a timeout delay on launch, because not every client has a webserver running on loopback port 80...
using "about:blank" eliminates this delay of course.
it would be nice to have HTML_BLANK_PAGE as a property for WebGMap!
at least to be able to choose between this two options.

Hi,


It is correct that using "http://127.0.0.1" as default URL is not always desirable.
We'll add an extra property to enable the use of a custom URL.
The update will be available with the next release of the TMS VCL WebGMaps.