Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jaxxed’s picture

Status: Active » Needs review
FileSize
9.28 KB

Patch

jaxxed’s picture

the polyline and polygon shapes require use of the google maps encoding and decoding functionality, which is inside an additional library. I will submit a core feature request to get google maps libraries functionality added properly.

jaxxed’s picture

Status: Needs review » Needs work

The new method for using polyline and polygon encoding requires that you include libraries when you make your first gmaps call. There is a patch to do it.
This patch provided will work, but will produce a JS error if you try to use encoded lines in the JS layer.

http://drupal.org/node/1984912

I will patch this code so that it skips the encoded shapes if the geometry library isn't loaded.

podarok’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Needs work » Postponed (maintainer needs more info)

folowing up
Looks like this one should be checked and updated in 7.x-2.x. mm??

jaxxed’s picture

I'll take a look at the D7 shapes now. With the libraries piece in place it should be smooth.

jaxxed’s picture

Status: Postponed (maintainer needs more info) » Needs review
FileSize
11.62 KB

Ok, applied now to 7.x-2.x and :

1. added checks on all google.maps.geometry calls to SILENTLY FAIL if the event isn't loaded (would prefer a console.debug or something but wasn't sure what to put there.)
2. cleaned some of the shape styling;
3. streamlined an if to a switch to remove redundant code

4. put in some comments
5. changed obj.vars.behaviors.shapesactions to shapesextraevents to be similar to the gmaps_marker

jaxxed’s picture

Assigned: jaxxed » Unassigned
podarok’s picture

here are the lot of javascript code
good to see some screenshots for making possible be sure this code is truly working before commiting into HEAD

jaxxed’s picture

Assigned: Unassigned » jaxxed

RE: #8 :I agree, it would be good. I have some screenshots that I can supply, but it's just for lines (encoded and decoded) and then some instances where i faked polygons from lines. If polygons work, then rpolygons will work, but I don't have any great testing spot for circles.

QUESTION: should the highlight.js implement highlights via shapes? there is an overlap in functionality, but I think that the usecases are so separate that they shouldn't be joined (adding shapes/removing shapes events shouldn't trigger on highlighting.)

I will try my best to give you a test spot this week with all of the implementations. THIS DOES NEED MORE REAL WORLD TESTING.

IMHO the changes won't be removed, but rather improved upon, as they fix the gmaps v2 retirement problem.

podarok’s picture

#6 commited pushed to 7.x-2.x-dev
will wait for #9

podarok’s picture

Priority: Major » Normal
Status: Needs review » Postponed

better status due to #9

jaxxed’s picture

I will have some time to put in today. I have only simulated environment tests (no drp7 real world cases.) I will put up a test site to demo.

J

jaxxed’s picture

Status: Needs work » Postponed
FileSize
1.55 KB

here is an additional patch for some problems with the previous patch. This patch was created from a diff taken from today's diff; is it ok to put this new patch in the same thread as the old patch?

DON'T USE THIS PATCH (see below)

jaxxed’s picture

Status: Postponed » Needs review

Here is a test site : http://drupal.12thirty4.com/gmaps/gmaptest/shapes

it's a quick site with some 200 nodes create with dev generate. some of them have locations. The form will pick a number of the locations, and use them for markers. You can pick a shape to switch from markers to a line or polygon. You can also bypass the location nodes by giving an encoded string.
Below the form is a var_export of the settings passed to the gmaps handler.

This site is currently open so you can play with it all you want. I will put http auth on it if traffic get weird or if the net-folks take advantage.

jaxxed’s picture

Status: Needs review » Needs work

I found another problem with the code. I will submit another patch.

jaxxed’s picture

Status: Postponed » Needs review
FileSize
3.65 KB

here is a better fix for some shapes problems.

the rpolygon case is still not working due to problems with the poly.js calcPolyPoints() function, which uses a function that converts latitiude into radians.

Is RPolygon still a priority.

jaxxed’s picture

The test site above now works for circles as well. For circles it adds a circle to every point for a node (no using encoding.)

I've tested the circles both with passing in a meters radius, and passing in a point2. The test site does both, but there is not control to switch between the 2. I am out of time to put into this today.

podarok’s picture

looking forward for latest patch for review with screenshots as working
Thanks for working on it!

jaxxed’s picture

Attached are screenshots from : http://drupal.12thirty4.com/gmaps/gmaptest/shapes

This is using the patch from #16, which applies to recent 7.x-2.x git

podarok’s picture

Status: Needs review » Fixed

#16 commited pushed to 7.x-2.x-dev
will be tagged in next RC release
thanks!!!

Status: Fixed » Closed (fixed)

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

dway’s picture

Well, it still does not work...
I did a patch 2 weeks ago, fixing little things that fixed the module.
But nobody tested this... :
https://drupal.org/node/1996416

dway’s picture

Issue summary: View changes

apparantly I can't spell