Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4919 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hello,

I'm trying to embed Google maps into a filemaker solution using the web viewer. This should be relatively straightforward with Google's API V3, but the web viewer is not rendering the map. For now, I'm only trying to get the web viewer to show one of the example maps from the Google maps API website, so I know this is not an issue with a calculation field incorrectly rendering the code.

The web address for my web viewer is:

"data:text/html," & Localities::Google_map_test

where Google_map_test is the field containing the relevant HTML/javascript code.

The contents of Google_map_test are:

<!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />

<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>

<title>Google Maps JavaScript API v3 Example: Marker Simple</title>

<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">

function initialize() {

var myLatlng = new google.maps.LatLng(-25.363882,131.044922);

var myOptions = {

zoom: 4,

center: myLatlng,

mapTypeId: google.maps.MapTypeId.ROADMAP

}

var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

var marker = new google.maps.Marker({

position: myLatlng,

map: map,

title:"Hello World!"

});

}

</script>

</head>

<body onload="initialize()">

<div id="map_canvas"></div>

</body>

</html>

I appreciate any suggestions.

  • Newbies
Posted

Update: I solved the issue by wrapping the javascript in PHP in order to call the GPS coordinates from Filemaker, and hosting the code with Apache. I wanted to avoid this because the data uri scheme seems to neat and clean, with no need for PHP files external to the Filemaker solution.

This topic is 4919 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.