Giter Site home page Giter Site logo

Comments (7)

edanao avatar edanao commented on May 22, 2024

experiencing the same issue. i tried adding it into a template or creating a new contenttype but with no luck. any solution?

thanks!

from bolt.

SahAssar avatar SahAssar commented on May 22, 2024

@edanao I'm pretty sure your problem is that you haven't set the google_api_key in your config.yml (if the field is showing, but not working.). If the field is just not showing at all perhaps you could open a new issue, as this one was about it not showing on the frontend and was solved four years ago.

from bolt.

edanao avatar edanao commented on May 22, 2024

thanks for the quick reply @SahAssar !
Yes the field is showing properly when creating the page after I added the google api key but it is not showing in the output page.

from bolt.

SahAssar avatar SahAssar commented on May 22, 2024

@edanao Ah, in that case you probably want to look at https://docs.bolt.cm/3.0/templates/record-and-records#geolocation which describes how to use the field. :)

from bolt.

edanao avatar edanao commented on May 22, 2024

thank you so much @SahAssar !
I just started Bolt 2 days ago.

Now my problem is that the page does not return any geolocation.
2016-08-04_1506

I created a new page and used a custom template to add the geolocation field. In the template twig, i added tags for the map display.

<h1>{{ record.title }}</h1> <div> <img src="http://maps.googleapis.com/maps/api/staticmap?center={{ page.geolocation.latitude }},{{ page.geolocation.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ page.geolocation.latitude }},{{ page.geolocation.longitude }}&key=AIzaSyCFho-vawlTpR2CfswI1GKx3JoPX6Tmulk"> </div> {{ fields() }}

It doesn't return any geolocation from the page object. :(

Again, thank you for your help!

from bolt.

SahAssar avatar SahAssar commented on May 22, 2024

If the geolocation field is in templatefields then you need to use page.templatefields.geolocation to access it, so the full snippet would be <h1>{{ record.title }}</h1> <div> <img src="http://maps.googleapis.com/maps/api/staticmap?center={{ page.templatefields.geolocation.latitude }},{{ page.templatefields.geolocation.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ page.templatefields.geolocation.latitude }},{{ page.templatefields.geolocation.longitude }}&key=AIzaSyCFho-vawlTpR2CfswI1GKx3JoPX6Tmulk"> </div> {{ fields() }}

Lemme know if it doesn't work out for you!

from bolt.

edanao avatar edanao commented on May 22, 2024

thank you @SahAssar ! it works! 👍 💯

from bolt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.