I'm building a Google Maps application and I'd like to read out the metadata, as specified by schema.org, from my HTML to plot my map markers.
For example:
<li itemscope="itemscope" itemtype="http://schema.org/LocalBusiness">
...some html...
<div class="geo" itemprop="geo" itemscope="itemscope" itemtype="http://schema.org/GeoCoordinates">
<meta itemprop="latitude" content="43.681505" />
<meta itemprop="longitude" content="-79.294455" />
</div>
</li>
Is there an easy way to query out the latitude and longitude values without having loop through everything?
Have you tried this?
jQuery(function($){
var latitude = $('.geo meta[itemprop="latitude"]').attr("content");
var longitude = $('.geo meta[itemprop="longitude"]').attr("content");
});
You can get at the data like so:
$('meta[itemprop="latitude"]').attr('content')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With