This module converts any image in a map with interactive pins on it.
Other map modules have some predefined maps that are not always the one we need.
Other techniques are not fast enough to implement ( vector maps, html map coordinates... ) and other are doesn't fit graphically ( google maps ).
This module creates a content type on install (and cleanly deletes it on uninstall) and displays the map on the edit/creation form. With one click you can give coordinates to the item inside the custom map.
The module creates a block that shows each instance of the content type Simple Pin Map Item as an accordion and also a pin on the map. A nice jQuery animation will show one or other content.
Drupal Core Version: 7.x
Link to sandbox project: http://drupal.org/sandbox/sergio.drupal/1784066
Git Clone: git clone http://git.drupal.org/sandbox/sergio.drupal/1784066.git simple_pin_map
Reviews of other projects
- http://drupal.org/node/1781984#comment-6477442
- http://drupal.org/node/1784482#comment-6477506
- http://drupal.org/node/1783722#comment-6510342
- https://drupal.org/node/1668528#comment-6544174
- https://drupal.org/node/1799252#comment-6561186
- http://drupal.org/node/1773526#comment-6561260
- http://drupal.org/node/1804878#comment-6568194
- http://drupal.org/node/1799196#comment-6568238
- http://drupal.org/node/1693054#comment-6568310
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | drupalcs-result.txt | 1.71 KB | klausi |
| #19 | drupalcs-result.txt | 3.5 KB | klausi |
| #4 | SimplePinMap.jpg | 65.26 KB | webdorado |
| simplepinmap-screenshot.png | 178.72 KB | cubeinspire |
Comments
Comment #1
klausiWelcome,
please get a review bonus first. Then try to fix issues raised by automated review tools: http://ventral.org/pareview/httpgitdrupalorgsandboxsergiodrupal1784066git
Comment #2
cubeinspire commentedHi i did a review to this module: http://drupal.org/node/1783722
Thank you for the Ventral I will check that up and correct what it's needed.
Comment #3
cubeinspire commentedI made all needed corrections to respect the Drupal code standards.
I have just have left 2 commented code lines at the end of the .module file because is a part I still need to work on it.
Does it pass the review now ?
Comment #3.0
cubeinspire commentedorthographic correction
Comment #4
webdorado commentedComment #5
cubeinspire commentedHi,
1. This problem could be from a wrong path to the file ( I check that from my side, but it used to work correctly in a fresh new install ) or a javascript problem. For that last situation, could you provide the browser version you used ? There was any kind of error on the firebug console so I have a lead to solve the problem ?
2. I checked that and it used to work. Maybe a syntax error when validating the Drupal Code Standards.
Thank you for the review, I repair that this weekend.
Comment #6
cubeinspire commentedHi again,
The bug 1 is solved. It was a problem with the path when the drupal installation is inside a subfolder.
The bug 2 was caused because the menu is cached so even if the module was uninstalled correctly, the menu item remained visible. I solved this by doing a clear cache after the module was uninstalled.
Comment #7
d2ev commentedit's good module and i look forward to using it.
I installed it and it works very well for my responsive theme. Fill out the to-do mentioned for administration interface for the image setup which is hardcoded now and this module should be in drupal contrib list.
Comment #8
cubeinspire commentedDone! Configuration page created using D7 configure = admin/simple_pin_map/customize on the .info file, allowing to upload a custom map file.
Comment #9
DmitriyMakeev commentedIt will be very useful module. But... ;)
1. Please change module package in .info file. I think "Blocks" or "User Interface" will be much better, instead of "logicdesign.be". Or you can simply remove it from .info file, and your module will be displayed in "Other" package.
2. Don't use jQuery(document).ready. You need to change JavaScript behaviors. Use
3. Also, you can place module settings on block configure page. See hook_block_configure()
Some minor bugs:
1. In "simplepinmap-edit.js" needs to add click event for #simplepinmap-marker. If i want to move the pin on a few pixels to the side, then it will not work. Or you can add ui-draggable library this will allow to drag the pin. Add this to form:
and use $('#simplepinmap-marker').draggable({ ... });
2. On configure page i would like to be able to select or upload icons for the pin.
Comment #10
DmitriyMakeev commentedforgot
Comment #11
cubeinspire commentedThanks for those good remarks Dmitriy !
I'm making those changes now.
Comment #12
cubeinspire commentedMajor bugs 1, 2 and 3 corrected.
Another bug found, concerning the managed file status (file was deleted after cron doh!).
Right now there are two ways to setup the map, from the configuration of the module and from the blocK, both save correctly the new map and change the status of the file to permanent.
Minor bug1: I have a better idea. I will put an invisible layer over the two images that will receive the click event. In that way the pin will not block the click on the map.
Minor bug2: Here the problem is that the pin need to have some conditions... is not like with the map image that you can upload everything... the pin is supossed to have the arrow marking the map in the exact middle of the image and the second image (the active state of the pin) should also look like the original pin image... otherwise the module will look wrong...
For that last question I consider the best idea would be to offer many pins pairs (inactive - active) from a GPL image stock.
Comment #13
cubeinspire commentedMinor Bug 1 implemented (with the layer idea) and commited.
For the minor bug 2... I don't know what would be better. As you said there are two options:
1. Let an upload form would give more freedom but also the possibility to "break" the module, and users with low graphic knowledge will make some very awfull things on the presentation;
2. Give a choice from a package of pin pairs will be a problem for users who knows about graphics but nothing about development... in that case she/he wouldn't be able to replace the marker files from the module correctly.
What do you suggest ?
Comment #13.0
cubeinspire commentedAdding reviews I made
Comment #13.1
cubeinspire commentedadding reviews
Comment #14
cubeinspire commentedApplying for a review bonus.
http://drupal.org/node/1781984#comment-6477442
http://drupal.org/node/1784482#comment-6477506
http://drupal.org/node/1783722#comment-6510342
Comment #15
DmitriyMakeev commentedI think 3 or 4 different pin pairs will be enough.
Comment #16
cubeinspire commentedWell I already made 14 pairs...
Comment #17
cubeinspire commentedGoing to commit this night
Comment #18
cubeinspire commentedLast implementation finished and commited.
Now the module allow the choice between 14 different pairs of pins.
There are also instructions on the README file about how to add a new custom file adding the file to the module folder directly.
Comment #19
klausiReview of the 7.x-1.x branch:
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:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #19.0
cubeinspire commentedadding reviews
Comment #19.1
cubeinspire commentedadding review to other projects
Comment #19.2
cubeinspire commentedAdd new review
Comment #20
cubeinspire commentedThank you for your review !
1. I changed the text from the sandbox trying to be more explicit. http://drupal.org/sandbox/sergio.drupal/1784066
2. Done
3. Done
4. Done
5. This module works with ANY image you want to upload and is not exclusive to a geographic zone. ( Europe map is the default one but you can change it on the module config or the block config pages).
There you can set an image with the map of Africa, an image with a map of the USA, an image with a map of your kitchen, an image with the photo of your Dog... well you got it.
6. Done
7. Done
8. Added check_plain() on the 4 fields, title, body, X and Y coords.
9. Done. Changed all IMG markers on the module.
10. $base_path is not the same as DOCUMENT_ROOT. In exchange is true that I can remove $_SERVER['PHP_SELF'] and put global $base_path instead. Those variable are there to ensure that the path won't be corrupt if the installation is not made on a classic root folder. ( see comment #4 ). I've added $base_path on simple_pin_map_block_save also.
11. Done
Comment #20.0
cubeinspire commentedchange text
Comment #21
cubeinspire commentedApplying to the second review bonus.
https://drupal.org/node/1668528#comment-6544174
https://drupal.org/node/1799252#comment-6561186
http://drupal.org/node/1773526#comment-6561260
Comment #22
mpdonadioThere are a whole bunch of tilde backup files under revision control. These should be deleted.
You should double check the CSS3 properties to see if you also need/want vendor prefixes to support people who may not have totally current browsers.
In you JS, you are using a closure like
but you are then using jQuery everywhere instead of $.
Your JS anonymous objects, (eg simplepinmap-edit.js:5) have trailing commas after the final element. Older versions of IE don't like this.
You also need to do a pass and clean up some minor formatting in the JS.
It looks like you are creating five variables in the hook_install() but only deleting two in the hook_uninstall().
simple_pin_map.form.inc has a no-op function that should be removed.
The alt and titles being added to the image are unstranslated strings.
Comment #23
cubeinspire commentedThat's Ubuntu gedit... deleted and changed the gedit config so it doesn't do it again...
The only CSS3 properties are only graphic minor improvements that doesn't affect at all to the functionability or the navigation ergonomy. Box shadow on the edit item on the node edition.
True and corrected.
Didn't knew that, thanks for the info and corrected.
Yes I see that, indentations are not allways right. 2 spaces. Corrected.
Hmm true, I have to delete 7 variables, 5 created on install and 2 inside the .module file. Corrected.
Wrong. This empty function need to be there, oherwise
function simple_pin_map_form_simplepinitem_node_form_alter(&$form, &$form_state, $form_id) {will not execute. Don't ask me why it happens I only know its like this...
Well ok :-) Corrected.
Comment #24
klausiReview of the 7.x-1.x branch:
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:
Not hard blockers, so I guess this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #25
cubeinspire commented1. I used to let some bread crumbs between my notes at school... I guess is not possible any more here :-). Corrected
2. I used this to allow my modules alter many forms at once in a separated file. Well I guess I don't need that as I just have a single form alter, so i deleted this, the separated file, the empty function and move the alter function to the module file.
You can see the original post with this idea here: http://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_form_FORM_ID_alter/7#comment-8714
3. See point 2
4. Corrected and also 2 more image attributes without t().
5. Corrected, and added the standardized documentation for forms.
This is ok also: http://ventral.org/pareview/httpgitdrupalorgsandboxsergiodrupal1784066git
Comment #25.0
cubeinspire commentedadded last review to get bonus
Comment #25.1
cubeinspire commentedadded a project review
Comment #25.2
cubeinspire commentedadding project review
Comment #26
cubeinspire commentedApplying for PARreview bonus.
Three more reviews:
Comment #27
patrickd commentedHi,
it seems that you are double-check-plaining the "simple plan map item content".
I get this as text when clicking on a pin in the block:
Sometimes, when editing the node, I was not able to set the pins position by clicking.
It just didn't move. I'm using chrome, no js errors occurred. Not sure what could be wrong here.
After reloading the page it worked again, maybe an issue with adding the js asset.
in urls I personally prefer dashes rather than underscores
admin/simple-pin-map/customize
It's okay to break long conditions, but some indenting would make it easier to read this code.
You usually do not set variables on installation. It's not an error but not the way it's designed for, best practices advice to use the default value.
The only real issue I see here is that your double-check-plaining the nodes contents on the block when clicking on a pin.
Beside this, thanks for your help in the application queue!
Thanks for your contribution!
I updated your account to let you 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 get 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.