Description
This module integrates as a geofield formatter. With some simple settings you will be able to add a Google Map with a custom style and marker to your node view. The build of the module was decided on the following research. This module has been made with the view to create a Google Styled Map with as few steps possible. So the pin and style of the Google Map can be easily changed. This module also makes use of the System Stream Wrapper module. With it you can easily define your marker image location ex. theme://mytheme/images/pin.png.

Project location
https://drupal.org/sandbox/iampuma/2208445

Repository
http://drupalcode.org/sandbox/iampuma/2208445.git

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iampuma/2208445.git styled_google_map

google-styled-maps

Reviews of other projects
* https://drupal.org/comment/8547065#comment-8547065
* https://www.drupal.org/node/2346321#comment-9199257
* https://www.drupal.org/node/2390489#comment-9568457

CommentFileSizeAuthor
styled-google-map.png614.59 KBiampuma

Comments

iampuma’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxiampuma2208445git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

iampuma’s picture

Issue summary: View changes
iampuma’s picture

Issue summary: View changes
iampuma’s picture

Status: Needs work » Needs review
sawtell’s picture

Status: Needs review » Needs work

Hi there,

styled_google_map.info
I can see that the system_stream_wrapper module is a dependency but I can only see two instances where it is being utilised.
Additional modules can add overhead, does system_stream_wrapper provide any gains over drupal_get_path in this scenario? (Could be that it does, just wanted to raise the point).

styled_google_map.module
The PHPDoc comment is missing the @return tag

styled-google-map.js
Comma on last array element needs to be removed. line 10 and line 32
Unnecessary comment on line 13

README.txt
Inconsistency for "Geofield" capitalisation line 4
Spelling error for "desired" line 32

Otherwise it all looks good.
I've installed the module successfully and implemented the display with various configurations that all work as expected.

Edit:
The git command in the original post should be:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/iampuma/2208445.git styled_google_map

iampuma’s picture

Issue summary: View changes
iampuma’s picture

Issue summary: View changes
iampuma’s picture

Status: Needs work » Needs review

As this module is created for having an easy setup. I concluded to use the system_stream_wrapper module. It gives many options without unnecessary complexity. As for the PHPDoc could you provide more info where the @return tag is needed. I could not find it in the Drupal Doxygen. All other remarks I have adjusted accordingly. Thanks for reviewing.

bmeme’s picture

Status: Needs review » Needs work

Hi there

I tried your module and it seems very ok. I would modify this only this:

'#options' => array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19),

into this:

'#options' => range(1,19),

everywhere you defined this array in your code. But it is only a matter of major code cleanup, the rest seems ok!!

iampuma’s picture

Status: Needs work » Needs review

Corrected the ranged arrays.

spficklin’s picture

Status: Needs review » Reviewed & tested by the community

Module looks good. It installed without issues and I was able to add a map to a content page. Paraview reports a few minor errors (http://pareview.sh/pareview/httpgitdrupalorgsandboxiampuma2208445git). But otherwise, the module, from my perspective, follows the checks describe here as well: https://www.drupal.org/node/1587704.

My only suggestion would be to add some additional documentation. For example there is no in-line documentation for the functions:

  • styled_google_map_field_formatter_settings_form()
  • styled_google_map_field_formatter_settings_summary()
  • styled_google_map_field_formatter_view()

Those functions all have some control logic which can help if described a bit. Also, you may want to describe how this module is significantly different from the Google Map Field module. But despite some of these minor issues looks good and works well!

iampuma’s picture

Added inline comments to functions with control logic as suggested. Fixed the Pareview issues as well.

iampuma’s picture

Status: Reviewed & tested by the community » Needs review

I recently added some changes to the module, which should not affect previous issues:
- Added the ability to use field groups inside the marker popup if available.
- Added multiple maps support on a single page.
- Added ajax called maps support for views with pagers and etc.

baddysonja’s picture

Status: Needs review » Reviewed & tested by the community

the new functionality works. I'm using it in two projects and haven't had any problems.

1xinternet’s picture

Works like a charm, thank you.

iampuma’s picture

klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +PAreview: security

Sorry for the delay. Make sure to finish your review bonus next time and this will get processed faster.

Review of the 7.x-1.x branch (commit 3d2c95a):

  • DrupalPractice has found some issues with your code, but could be false positives.
    FILE: /home/klausi/pareview_temp/styled_google_map.module
    ---------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------
     6 | WARNING | @author tags are not usually used in Drupal, because over
       |         | time multiple contributors will touch the code anyway
    ---------------------------------------------------------------------------
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. project page is a bit short. Perhaps you could add more useful information according to https://www.drupal.org/node/997024 ?
  2. You have committed styled_google_map.rar to git which is a broken RAR archive of the module and should be removed.
  3. styled_google_map_field_formatter_view(): no need to use #markup here, you can directly use your theme function with the #theme key in render arrays, see https://www.drupal.org/node/930760
  4. styled_google_map_field_formatter_settings_summary(): The ":" placeholder does not exist for t(). Use "@" or "%" instead, see https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7
  5. theme_styled_google_map(): this is vulnerable to XSS exploits. If I enter 5'"><script>alert('width');</script> as width in the formatter settings I will get a nasty javascript popup when the field is displayed. You need to sanitize all user provided text before printing to HTML. Make sure to read https://www.drupal.org/node/28984 again. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.
iampuma’s picture

Status: Needs work » Needs review

@Klausi thank you for reviewing! And yes, I noted down finishing the review bonus for next time.

Following points were looked at:
1. The author tag in the module file has been removed.
2. The .rar file should not have been there. This is removed from the repository.
3. #Markup attribute is removed.
4. Incorrect ":" placeholders are replaced by "%".
5. Additional sanitizing functions are used before display.

As last I will update the project page, with more information.

iampuma’s picture

Issue summary: View changes
iampuma’s picture

Issue summary: View changes
iampuma’s picture

Issue summary: View changes
iampuma’s picture

The project page description is updated!

iampuma’s picture

Issue summary: View changes
Issue tags: ++PAReview: review bonus
klausi’s picture

Issue tags: -+PAReview: review bonus +PAreview: review bonus

Fixing tag.

klausi’s picture

Assigned: Unassigned » dman
Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus

Review of the 7.x-1.x branch (commit 07e66e5):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: /home/klausi/pareview_temp/styled_google_map.module
    --------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     396 | WARNING | Line exceeds 80 characters; contains 88 characters
    --------------------------------------------------------------------------------
    
    Time: 327ms; Memory: 10.5Mb
    
  • No automated test cases were found, did you consider writing Simpletests or PHPUnit tests? This is not a requirement but encouraged for professional software development.

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. styled_google_map_field_formatter_view(): do not call theme() here, just return the render arrays, Drupal will render them later for you. See https://www.drupal.org/node/930760
  2. styled_google_map_field_formatter_settings_summary(): The ":" placeholder does not exist for t(). Use "@" or "%" instead, see https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/t/7

But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

Assigning to dman as he might have time to take a final look at this.

iampuma’s picture

Thank you for another review @klausi. Your suggestions should be fixed.

  • Fixed exceeding characters on line 296
  • Replaced the theming function in favor for a render array
  • Fixed the forgotten placeholders
kscheirer’s picture

Assigned: dman » Unassigned
Status: Reviewed & tested by the community » Fixed

Sorry, I got to this first on account of the ticket being so old. Thanks for addressing the duplication issue on the project page. Did not find any security, licensing, Drupal API, or individual account issues.

Thanks for your contribution, iampuma!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.