Tommy B
Posts: 0
Joined: Sat Sep 15, 2012 3:39 am

Placing Static Map in Panel

I am trying to to place a static google map in a panel. My catch is that the Lat and Long for the map reside in two hidden labels on the same screen. Here is what i have so far. I see a map but it is not proper. I am thinking my issue is in the var latlong or in the var img_url?

Please note that for this post I have added the lat and long label data.

precode
<!DOCTYPE html>
<html>
<body>
<div id="mapholder"><&#47;div>
<script>

var getlat = Appery ('latLbl')&#46;text(47&#46;6063889);
var getlong = Appery ('longLbl')&#46;text(-122&#46;3308333);
var latlong = getlat+','+getlong;

var img_url="http:&#47;&#47;maps&#46;googleapis&#46;com&#47;maps&#47;api&#47;staticmap?size=250x250&maptype=hybrid
<!DOCTYPE html SYSTEM

Image";

function showError(error)
{
switch(error.code)
{
case error.PERMISSION_DENIED:
x.innerHTML="User denied the request for Geolocation."
break;
case error.POSITION_UNAVAILABLE:
x.innerHTML="Location information is unavailable."
break;
case error.TIMEOUT:
x.innerHTML="The request to get user location timed out."
break;
case error.UNKNOWN_ERROR:
x.innerHTML="An unknown error occurred."
break;
}
}

amp;markers=size:mid%7Ccolor:red%7C"+latlong+"&sensor=false&quot

document&#46;getElementById("mapholder")&#46;innerHTML="<img src='"+img_url+"'>&quot

function showError(error)
{
switch(error&#46;code)
{
case error&#46;PERMISSION_DENIED:
x&#46;innerHTML="User denied the request for Geolocation&#46;"
break;
case error&#46;POSITION_UNAVAILABLE:
x&#46;innerHTML="Location information is unavailable&#46;"
break;
case error&#46;TIMEOUT:
x&#46;innerHTML="The request to get user location timed out&#46;"
break;
case error&#46;UNKNOWN_ERROR:
x&#46;innerHTML="An unknown error occurred&#46;"
break;
}
}
<&#47;script>
<&#47;body>
<&#47;html>
/code/pre

Return to “Issues”