Pronamic Google Maps
[resolved] Get link to map on maps.google.com (4 posts)

  1. gluethje
    Posted 4 years ago #

    I am having this issue:

    I want the map so be static so it doesn't mees up scrolling on the page. If map is dynamic and the cursor is inside the map and you scroll, it scrolls the map and not the page, which can get annoying, especially on small screens.

    But the static map is, well, static. It would be great to be able to generate a link to the map on google.com if the visitor want to scroll, get directions etc. How would I go about this?


  2. Tibor Paulsch
    Posted 3 years ago #

    You could use the post meta field _pronamic_google_maps_address and add that to a link to google maps.

    I guess you would need something like this in your template somewhere:

    printf ( '<a href="http://maps.google.com/maps/?q=%s">link to map</a>', get_post_meta($post->ID, '_pronamic_google_maps_address' ) );
  3. aswartzell
    Posted 3 years ago #

    wonderful idea, gluethje. one little tweak to tibor's code (pass true to the get_post_meta function) and we're good to go:
    <?php printf ( '<a href="http://maps.google.com/maps/?q=%s">View in Google Maps</a>', get_post_meta($post->ID, '_pronamic_google_maps_address' , true ) ); ?>

  4. Remco Tolsma
    Plugin Author

    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Pronamic Google Maps
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic