Forum Academy Marketplace Showcase Pricing Features

Instance publishState ('geographicAddress', ?)

Does anyone know how to publish a state that is defined as a geographic address? I tried passing in the following:
`let center = {
address: ‘’,
lat: 29.198,
lon: -100
}

instance.publishState(‘center’, center)`

This did not work. I also tried a string and just an array.

I’ve not messed with it at all, I’d imagine addresses are stored using a geoJSON format. Have you tried that?

That works, but from what I have found the address cannot be left null or empty string for it to be accepted by bubble database. Thanks!

Can you copy paste this one? Yours looks close but this is a validated Json. Should work if this is what the dB is asking for

{
    "address":"",
   "lat":29.198,
   "lon":-100
}
1 Like

Yeah that works. I put the name of the object properties in quotes and it accepted it. I haven’t tried it with an empty address because I just reverse geocoded to get the address since I already had the coordinates. But I am assuming that it was because I didn’t have it in that format at first is why it didn’t work for me at first.

1 Like