Selected a location in the backend and now trying to display it on the front end of the site. The below code doesnt work:
<asp:Content ContentPlaceHolderID="Header" runat="server">
</asp:Content>
<asp:Content ContentPlaceHolderID="Main" runat="server">
<div id="map1" class="map" style="height:500px; width:500px;">
<umbraco:Item field="place1" runat="server"></umbraco:Item>
</div>
<script>
if (typeof ItemEditing == 'undefined') {
$('div[class=map]').each(function() {
$(this).addClass('mapdimensions');
var mapId = $(this).attr('id');
var value = $(this).html();
value = $.trim(value);
var point = value.split(',');
var lat = parseFloat(point[0]);
var lon = parseFloat(point[1]);
var zoom = parseFloat(point[2]);
fm.maps[fm.maps.length] = new GMap2(document.getElementById(mapId));
var m = fm.maps[fm.maps.length-1];
var p = new GLatLng(lat, lon);
m.setCenter(p, zoom);
var marker = new GMarker(p);
m.addOverlay(marker);
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=qwertyuioplhfds"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
</asp:Content>
Map not displaying
I have installed this component in Umbraco 6.
Selected a location in the backend and now trying to display it on the front end of the site. The below code doesnt work:
Could anyone advise why?
Hi J
Do you get any error messages in your browsers console log?
/Jan
is working on a reply...