Google Maps

Hi!

I’m using the Google Maps field in a grid. Not all the entries of the grid have “latitude” and “longitude” info in the database but I have a google maps button on every entry, even if they don’t have info about latitude and longitude.

I would want to hide the Google Maps button when the entries don’t have latitude and longitude info.

What should I do?

Thanks!

Re: Google Maps

You can try this way, in the event onScriptInit, use a “if else” clause if the field for example “Longitude” is empty, use the macro sc_field_display({field},on/off); in this condition

regards

Re: Google Maps

Hi!
Thanks for your reply.

I’m using this code:

/**

  • Hide/show a field
    */

if ({latitut} > 0) // Display field
{
sc_field_display({mapa}, ‘on’);
}

else // Hide field
{
sc_field_display({mapa}, ‘off’);
}

The field in which I display the google maps is called “mapa”. If I add this code, the field called “Mapa” never shows.
Is there anything I’m doing wrong?

Thanks