AnsweredAssumed Answered

Web Viewer Map Integration

Question asked by angeldejesus on Jul 6, 2018

Hi, I'm working on a FileMaker Web Integration with a Google Maps JavaScript API, I tested the HTML, CSS and JavaScript code in a browser and it works perfectly, it shows me the map and the marker in the coordinates I want, then I pasted the code in a web viewer on my filemaker layout and I added some quotation marks where needed, and it also worked but not the way I wanted, It should get the coordinates from two different fields on my layout: the latitude and the longitude field I have tried different ways to do this, but it doesn't work.

 

On  javascript the map code is:

 

<script>

 

        function initMap(){

 

            // Map options

 

            var options = {

 

                zoom: 13,

 

                center:{lat:18.898696999999999,lng:-98.251587000000001}

 

            }

 

            // New map

 

            var map = new

 

            google.maps.Map(document.getElementById('map'), options);

 

            //Add marker

 

            var marker = new google.maps.Marker({

 

                position:{lat:18.898696999999999,lng:-98.251587000000001},

 

                map:map,

 

                icon:'https://developers.google.com/maps/documentation/javascript/examples/full/images/beachflag.png'

 

            });

 

        }   

 

    </script>

 

The map gets the coordinates from center:{lat:18.898696999999999,lng:-98.251587000000001} and position:{lat:18.898696999999999,lng:-98.251587000000001},

 

That doesn't work for me, I need the map to get the coordinates from my layout fields, I have tried this:

 

center:{lat:\"Captadores 2017::Latitud\",lng:\"Captadores 2017::Longitud,\"}

 

position:{lat:\"Captadores 2017::Latitud,\",lng:\"Captadores 2017::Longitud,\"},

 

 

Also I tried by placing the code in a field Layout called HTML where I changed the code to:

 

center:{lat:<<latitud>>,lng:<<longitud>>

 

position:{lat:<<latitud>>,lng:<<longitud>>},

 

And I created a calculation field called HTML_Calc_ForLibraryUseOnly unstored but It didn't work:

 

Substitute ( HTML; ["<<latitud>>" ; Latitud];

 

                   ["<<longitud>>" ; Longitud]

 

)

 

And I managed a Custom Function called Map where I wrote:

 

Substitute ( Latitud ; "<<latitud>>" ; Captadores 2017::Latitud ) &

 

Substitute ( Longitud ; "<<longitud>>" ; Captadores 2017::Longitud )

 

And it still doesn't work this is very frustating I have worked on this since Monday, please help me!!

Outcomes