Forums

Pronamic Google Maps
[resolved] Map widths in Percentages/Ems/Auto etc. (4 posts)

  1. Ben B
    Member
    Posted 6 months ago #

    Hello!

    Is it possible to use other dimension types in the shortcodes? I'd like to be able to use percentages, for example.

    Thanks

    Ben

    http://wordpress.org/extend/plugins/pronamic-google-maps/

  2. daybot
    Member
    Posted 6 months ago #

    Not the best solution, but if you go into

    pronamic-google-maps -> classes
    and open
    Pronamic_Google_Maps.php

    go to line 270 and

    replace
    $content .= sprintf('<div class="canvas" style="width: %dpx; height: %dpx;">', $info->width, $info->height);

    with
    $content .= sprintf('<div class="canvas">', $info->width, $info->height);

    Then you can control the size of the map in css either in percentage or pixels.

    David.

  3. Ben B
    Member
    Posted 6 months ago #

    Thanks for the pointer, David. While I couldn't get your code to work directly; I was able to amend the code to append 'px' to height and '%' to width which gave me the result I was after.

    Thanks!

    Ben

  4. Remco Tolsma
    Member
    Posted 6 months ago #

    Unfortunately it is not possible to use another dimension type. Adjusting the core files of the plugin isn't a very nice solution. These changes are likely to be lost during an update.

Reply

You must log in to post.

About this Plugin

About this Topic