I am trying to set the latlng of my map from a data tag using jQuery. For some reason it won't ever work. If I hard code the value its fine, but if I try and call it from the data tag it just fails but has no js errors.
Any help gratefully appreciated
$(function (){
var co = $("#map").data("co");
var map;
var myLatlng = new google.maps.LatLng(co);
var mapOptions = {
center: myLatlng,
zoom: 4
};
map = new google.maps.Map(document.getElementById("map"), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'title',
icon: 'http://www.richardgrantham.com/img/marker.png'
});
});