Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've got a custom module to create a gmap using the api. As soon as I add a "shapes" array, it does not display, nor do any markers that I have set up (which shows ok, with no "shapes" included). However, if I revert the module back to 7.x-1.0-beta1, the shapes and markers load up ok.
Comment | File | Size | Author |
---|---|---|---|
#24 | 2013-03-13 01.14.57 pm.png | 117.96 KB | iancawthorne |
#24 | 2013-03-13 01.13.28 pm.png | 129.17 KB | iancawthorne |
#20 | gmap-shapes-support-1887506-20.patch | 2.75 KB | iancawthorne |
#5 | gmap-shapes-support-1887506-5.diff | 2.93 KB | iancawthorne |
Comments
Comment #1
podarokfeel free to reopen this when bug still hosts at latest dev
Comment #2
iancawthorne CreditAttribution: iancawthorne commentedHi podarok
I've just given this a try on the latest dev (and also the 2.4 release) and am getting the same problem. As soon as I comment out the shapes array, the pins I also have set up show ok.
Is there anything can do to help with this?
Comment #3
podarokYup
Please, Do provide a patch against latest dev with test coverage for fix and post it here
Comment #4
iancawthorne CreditAttribution: iancawthorne commentedI will take a longer look at this (not being the most fluent in javascript!), but for now a few notes on the problem...
This is the line that is kicking the error in the console (line 125 of gmap_shapes.js) and commenting it out at least allows the markers to show, so there are no js errors..
obj.map.addOverlay(shape.shape);
This is the error that is given...
TypeError: 'undefined' is not a function (evaluating 'obj.map.addOverlay(shape.shape)')
Comment #5
iancawthorne CreditAttribution: iancawthorne commentedI've attached a patch which should allow polylines and polygons to work.
Comment #6
johnvbetter status.
@iancawthorne , ou t of curiosity: does your patch revert the 1.x status, or does it contain new code?
Comment #8
iancawthorne CreditAttribution: iancawthorne commentedOops forgot to add the correct file extension. This one should work.
@johnv I'm not sure what you mean? This patch is for the 2.x branch of the module, not 1.x.
Comment #9
johnv@iancawthorne, Yes, I know. But since "if I revert the module back to 7.x-1.0-beta1, the shapes and markers load up ok", I was wondering if you undid/reverted any changes from the 2.x branch.
Comment #10
podarokping bot with a status "needs review"
Comment #11
podarokYou should use whitespaces not tabs in code http://drupal.org/coding-standards#indenting
Comment #13
podarokYour patch can`t be applied to 7.x-2.x-dev version
needs reroll
Comment #14
iancawthorne CreditAttribution: iancawthorne commentedUpdated patch attached with tabs converted to spaces.
@johnv As far as I can tell, the current 2.x shapes javascript file hasn't been touched and is a direct copy from the 1.X branch. Gmap API3 is different to API2 for shapes so this patch addresses this, so as far as I can tell there aren't any changes undone on the 2.x branch .
Comment #15
podarokYou should set needs review for testbot
Comment #17
podarokpatch can`t be applied to current 7.x-2.x
needs reroll
Comment #18
iancawthorne CreditAttribution: iancawthorne commentedHi podarok,
I'm not sure what I need to do to the patch for it to apply to the current 7.x-2.x
I've made the patch against 7.x-2.x from the git repository. (This is the first patch I've made).
Comment #19
podarokhttp://qa.drupal.org/pifr/test/460798
testbot couldn`t apply Your patch
so
git pull 7.x-.2x --rebase
git diff 7.x-2.x > patch.patch
and post it here for review
Comment #20
iancawthorne CreditAttribution: iancawthorne commentedThanks podarok, here's another attempt!
Comment #21
podarokpatch looks nice
looks like this code needs manual testing
I`ll be glad to see a few screenshots...
Comment #22
iancawthorne CreditAttribution: iancawthorne commented@podarok What sort of screenshots would you like to see? I've been using the gmap api for my testing.
Comment #23
podarok#20 with and without patch
as I see - patch touches js layer, and testing system can`t be hlpfull with quality check. So screenshots are good enouph for comiting this into repository
Comment #24
iancawthorne CreditAttribution: iancawthorne commentedTwo screenshots attached (hopefully what you would like). First shows the Google Map with markers and pins set, but nothing rendering on the map. Second shows the same page with the patch applied with the markers and shape (polyline) loading up ok.
Comment #25
podarokThanks!!!!
removing tag
Comment #26
podarok#20 commited pushed to 7.x-2.x-dev
will be tagged in feature minor update release
Thanks!
Comment #27
podarokhttp://drupal.org/node/1941774 created release
Comment #28
zhuber CreditAttribution: zhuber commentedI'm using 7.x-2.x-dev and I still cannot get my polygon to show up on my gmap view, is there something I'm doing wrong?
It looks correct to me, but it doesn't render out any shapes on the map:
Comment #29
gillarf CreditAttribution: gillarf commentedI have exaclty the same problem. @zhuber Did you find a solution to this?
I am not able to change anything in the $map array at all in pre_theme_map.
Comment #30
zhuber CreditAttribution: zhuber commentedI was able to get it to work at one point, but I'm not sure what I did to fix it. I may have fixed it by messing with the module weight. It was a while back, but I remember messing with the module weights quite a bit in an effort to get this hook to work.
Comment #31
podarokdue to #30 closing this issue
please - create new follow-up issue with a proper issue template filled and how-to reproduce a bug
Comment #32
jboeger CreditAttribution: jboeger commentedI cannot get shapes to work on any recent version of gmap (production and dev.)
Switching themes etc and nothing works. I have employed patches for markers and
now the markers are working.
when I go to /map/macro
I am able to put a point on the map. Nothing happens when I try line, circle,
or polygon... except for a resulting error on my logs page:
Theme hook gmap_macro not found.
Any ideas?