I've captured the xml output.

If I add the latitude and longitude like this:
        $newEntry->addGbaseAttribute('latitude', $offer->lat, 'text');
        $newEntry->addGbaseAttribute('longitude', $offer->lng, 'text');

Output becomes:

<atom:entry xmlns:atom="http://www.w3.org/2005/Atom";>
  <atom:title type="text">Apartament</atom:title>
  <atom:content type="text"><p>Ap internet</p> <p>&nbsp;</p>
<p><strong>210Eu+garantie 1luna.</strong></p> <p>&nbsp;</p>
<p><strong>Tel. </strong></p> <p>&nbsp;</p></atom:content>
  <item_type xmlns="http://base.google.com/ns/1.0";
type="text">Housing</item_type>
  <link xmlns="http://base.google.com/ns/1.0"; type="url">http://
www.site.ro/offer.php?id=77</link>
  <listing_type xmlns="http://base.google.com/ns/1.0"; type="text">for
rent</listing_type>
  <price xmlns="http://base.google.com/ns/1.0"; type="text">210 eur</
price>
  <id xmlns="http://base.google.com/ns/1.0"; type="text">77</id>
  <listing_status xmlns="http://base.google.com/ns/1.0";
type="text">active</listing_status>
  <parking xmlns="http://base.google.com/ns/1.0"; type="number">1</
parking>
  <expiration_date xmlns="http://base.google.com/ns/1.0";
type="dateTime">2009-11-20</expiration_date>
  <latitude xmlns="http://base.google.com/ns/1.0";
type="text">45.782519139800000</latitude>
  <longitude xmlns="http://base.google.com/ns/1.0";
type="text">24.149360060700000</longitude>
  <location xmlns="http://base.google.com/ns/1.0";
type="location">sibiu, romania</location>
  </atom:entry>


It ignores them. It uses the address to geocode. Interesting, they
seem to suggest that this would work, according to:

        
http://base.google.com/base/api/itemTypeDocs?verticalName=housing&verticalLocale=en_US
        (see Entry Example at the bottom)


I then try another method - trying to generate something similar to
what I found in the documentation (http://code.google.com/intl/ro-RO/
apis/base/starting-out.html#latlong):

<g:location>
    My Favorite Beach
    <g:latitude>37.0</g:latitude>
    <g:longitude>-122.5</g:longitude>
</g:location>

Here is the code:

        $location .= "<g:latitude>{$offer->lat}</g:latitude>";
        $location .= "<g:longitude>{$offer->lng}</g:longitude>";

Here is what it does to the tags in the output (it html escapes them):

        <location xmlns="http://base.google.com/ns/1.0";
type="location">sibiu, romania&lt;g:latitude&gt;45.782519139800000&lt;/
g:latitude&gt;&lt;g:longitude&gt;24.149360060700000&lt;/
g:longitude&gt;</location>

Any ideas? Thanks.

--

You received this message because you are subscribed to the Google Groups 
"Google Base Data API" group.
To post to this group, send email to [email protected].
For more options, visit this group at 
http://groups.google.com/group/google-base-data-api?hl=.


Reply via email to