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.

Files: 
CommentFileSizeAuthor
#24 2013-03-13 01.14.57 pm.png117.96 KBiancawthorne
#24 2013-03-13 01.13.28 pm.png129.17 KBiancawthorne
#20 gmap-shapes-support-1887506-20.patch2.75 KBiancawthorne
PASSED: [[SimpleTest]]: [MySQL] 122 pass(es).
[ View ]
#5 gmap-shapes-support-1887506-5.diff2.93 KBiancawthorne
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap-shapes-support-1887506-5.diff. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Version:7.x-2.2» 7.x-2.x-dev
Status:Active» Closed (cannot reproduce)

feel free to reopen this when bug still hosts at latest dev

Status:Closed (cannot reproduce)» Active

Hi 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?

Yup
Please, Do provide a patch against latest dev with test coverage for fix and post it here

I 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)')

StatusFileSize
new2.93 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap-shapes-support-1887506-5.diff. Unable to apply patch. See the log in the details link for more information.
[ View ]

I've attached a patch which should allow polylines and polygons to work.

Status:Active» Needs review

better status.
@iancawthorne , ou t of curiosity: does your patch revert the 1.x status, or does it contain new code?

Status:Needs review» Needs work

The last submitted patch, gmap-shapes-support-1887506-5.diff, failed testing.

StatusFileSize
new2.95 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap-shapes-support-1887506-5.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Oops 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.

@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.

Status:Needs work» Needs review

ping bot with a status "needs review"

+++ b/js/gmap_shapes.jsundefined
@@ -118,17 +129,16 @@ Drupal.gmap.addHandler('gmap', function (elem) {
-    if (obj.vars.behavior.clickableshapes) {
+   /*if (obj.vars.behavior.clickableshapes) {
       GEvent.addListener(shape.shape, 'click', function () {

You should use whitespaces not tabs in code http://drupal.org/coding-standards#indenting

Status:Needs review» Needs work

The last submitted patch, gmap-shapes-support-1887506-5.patch, failed testing.

Your patch can`t be applied to 7.x-2.x-dev version
needs reroll

StatusFileSize
new3.04 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch gmap-shapes-support-1887506-14.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Updated 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 .

Status:Needs work» Needs review

You should set needs review for testbot

Status:Needs review» Needs work

The last submitted patch, gmap-shapes-support-1887506-14.patch, failed testing.

patch can`t be applied to current 7.x-2.x
needs reroll

Hi 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).

http://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

Status:Needs work» Needs review
StatusFileSize
new2.75 KB
PASSED: [[SimpleTest]]: [MySQL] 122 pass(es).
[ View ]

Thanks podarok, here's another attempt!

Status:Needs review» Needs work
Issue tags:+Needs manual testing

patch looks nice
looks like this code needs manual testing
I`ll be glad to see a few screenshots...

@podarok What sort of screenshots would you like to see? I've been using the gmap api for my testing.

#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

StatusFileSize
new129.17 KB
new117.96 KB

Two 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.

Assigned:Unassigned» podarok
Issue tags:-Needs manual testing

Thanks!!!!

removing tag

Assigned:podarok» Unassigned
Status:Needs work» Fixed

#20 commited pushed to 7.x-2.x-dev
will be tagged in feature minor update release

Thanks!

Status:Fixed» Closed (fixed)

I'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:

/*
* Implements hook_gmap().
*/
function example_gmap($op, &$map) {
  if (!empty($map) && $op == 'pre_theme_map') {
    $shapes = array();
    $shapes[] = array(
      'type' => 'polygon',
      'points' => array(
        array(32.940318, 117.065921),
        array(32.990318, 117.065921),
        array(33.0, 117.0),
        array(33.0, 117.65921),
      ),
      'style' => array('ff0000', 5, 80, '00ff00', 60),
    );
    $map['shapes'] = $shapes;
  }
}

I 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.

I 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.

Issue summary:View changes
Status:Closed (fixed)» Closed (cannot reproduce)

due to #30 closing this issue
please - create new follow-up issue with a proper issue template filled and how-to reproduce a bug