Topic: Support/Comments for GoogleMapMarker  (Read 53969 times)

Pages: 1 [2] 3 4 ... 11   Go Down

#21: 26-Sep-2006, 07:53 AM

Coding Team

doze
Posts: 4,111

....Boom!

Above problem solved:

The javascripts was not automatically added to the header because the snippet was called uncached and the document was set to not cacheable. There is a bug in 0.9.2.1 that it doesn't add the scripts under these circumstances. Fix is to set the document to be cached or change the snippet call to cached.
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#22: 1-Oct-2006, 03:20 PM

Briggsy
Posts: 372

WWW
I seem to have the problem of the map being displayed with no marker, below is the call.

Code:
[!GoogleMapMarker? &apiKey=`ABQIAAAAXRc3ux_EqbCe8bFxzSLOvRSrwFah6sw7ECeyvYp9iBvJVRv7phRnPAFTj_Nz3iboAySEJvBZoKR3tw` &mapControl=`small` &mapTypeControl=`none` &defaultZoom=`16` &centerPos=`-40.357713,175.611434` &startID=`122` &tpl=`GoogleMap`!]

The page is set to cacheable and the script is added to the header

Code:
<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAXRc3ux_EqbCe8bFxzSLOvRSrwFah6sw7ECeyvYp9iBvJVRv7phRnPAFTj_Nz3iboAySEJvBZoKR3tw"></script>

StartID is set to 122, which has a child document of 123. The description filed of the document has the location, which is "-40.357713,175.611434" (without quotes). Could the fact that it has a - have anything to do with it?

As usual it is in my Sandbox
« Last Edit: 1-Oct-2006, 03:37 PM by Briggsy »
Emergency Management Academy of New Zealand
      http://www.emanz.ac.nz

MODx Sandbox   Login: sandbox  Password: castle

Admin Sandbox   Login: sandbox  Password: castle

#23: 1-Oct-2006, 03:37 PM

Coding Team

doze
Posts: 4,111

....Boom!

Use the Javascript console in Firefox to see what problems the script is probably causing.. there are some things that you need to be aware of when making marker documents:

  • You need to escape all single quotes and brackets with backslash (plus maybe some other chars too).. eg. ' becomes \' and ( becomes \( etc.. in title field too.
  • Don't publish the marker documents.. or if you want to publish them, use &showOnlyPublished parameter
  • Make sure that marker document content does not span to multiple lines (disabling RTE for markers is the best way to achieve this)

Some of these issues will be fixed when I get the time to do a new version of this snippet. I have planned to use more of Google map api features such as driving directions, marker images, rulers etc.. but currently, I don't have time to look at this.
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#24: 2-Oct-2006, 01:24 AM

Briggsy
Posts: 372

WWW
Don't publish the marker documents.. or if you want to publish them, use &showOnlyPublished parameter

That fixed it, mine was published in an unpublished folder.  Cheers.
Emergency Management Academy of New Zealand
      http://www.emanz.ac.nz

MODx Sandbox   Login: sandbox  Password: castle

Admin Sandbox   Login: sandbox  Password: castle

#25: 5-Oct-2006, 07:03 PM

lach
Posts: 27

Hi, i was just wondering i have the make maker working and i think it is great, but it puts the map inside <p></p> is there any way to display the map without putting it inside the paragraph tags? thanks lach.

#26: 6-Oct-2006, 11:17 AM

Coding Team

doze
Posts: 4,111

....Boom!

I believe it's your RTE that's doing this. You can remove the paragraph tags if you use the "source" button of your RTE or by disabling RTE altogether... There is also a configuration setting in the rte's that you can switch to disable it automatically wrapping everything in paragraphs.. You can find help on this issue by searching the forum (use google).
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#27: 8-Oct-2006, 06:05 PM

lach
Posts: 27

hi, doze thanks very much!!! i disabled RTE and it fixed it perfect.. thanks lach.

#28: 15-Oct-2006, 10:33 AM

JoeP
Posts: 65

Hi All!
I am VERY new to MODx and of course this snippet.  Both seem to be great!  Thanks to all involved!
Now, the questions...
1.  Does the license allow mods to the script?
2.  Has anyone tried a mod that would return a lat/lon rather from a user click on the map in addition to or in place of having a list of locations to choose from?

On #2 I'm thinking that it would be a very useful tool when coupled with other utilities like Googles Geocoding, weather sites, etc.
Thanks,
joe

#29: 15-Oct-2006, 10:41 AM

Coding Team

doze
Posts: 4,111

....Boom!

1. Do anything you want with it.
2. Not that I'm aware of. You mean that when user clicks on the map, just anywhere, it will show the latitude/longitude of that position? Or do you mean that it would show the lat/lon in the marker popups when user clicks them, instead of the document content?

Google maps API has evolved greatly from when I did this snippet and also Ditto (what is used in this snippet) has opened new possibilities. I have thinked about including driving directions feature in next version if I do one, but have been waiting for google to make it possible in Finnish maps too. It is possible allready at some stage with geocoding so it could be time to look at this soon..

I don't use this my self, just did it for a friend that needed one. So if you have any wishes for the next version, list them here! That goes for anyone.
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#30: 15-Oct-2006, 02:52 PM

JoeP
Posts: 65

What i was thinking of was not that it would display the coordinates, but it would return the coordinates as well as the click event.  This could be used to trigger another routine (don't know what the correct MOBx lingo is yet) such as one that would display the forecast for that location or the traffic conditions, population density... or whatever.

Perhaps the map routine could even be equiped with a listener registration so that one could tie arbitrary routine(s) to the map click event.

Just thinking out loud here... I have a long way to go before I start working on this stuff.

joe

#31: 15-Oct-2006, 03:32 PM

JoeP
Posts: 65

Very Cool!  I just got my first map up in MODx.
A recommendation...
In the source file it says:
Quote
* 3. Add the &startID parameter to the snippet call pointing to the folder what has the marker documents
 *    example: [[GoogleMapMarker? &apikey=`ABQIA..` &startID=`52`]]

where it says "&apikey" it shoud say apiKey.

Also to center the map where you want, use something like:
 [[GoogleMapMarker? &apikey=`ABQIA..` &startID=`52` &centerPos = 38, -120]]
No quotes or anything around the lat, lon values.

Didn't take long to figure it out, but would have been immediate success with these little tidbits.

Thanks for the great work!!!
joe

#32: 15-Oct-2006, 04:03 PM

Coding Team

doze
Posts: 4,111

....Boom!

What i was thinking of was not that it would display the coordinates, but it would return the coordinates as well as the click event. 

....

Perhaps the map routine could even be equiped with a listener registration so that one could tie arbitrary routine(s) to the map click event.
That would be more on the google map api + javascript side than in the snippet side to add specific handlers. Look here for a list of available events that the api offers..

To have click handler for example, you would need to add something like this:

GEvent.addListener(map, 'click', function(overlay, point){
   alert("long = " + point.x + ", lat = " + point.y);
}

etc..

Very Cool!  I just got my first map up in MODx.
A recommendation...

Thanks, I'll fix those..
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#33: 16-Oct-2006, 07:51 AM

JoeP
Posts: 65

fyi
I happened to stumble across this post in the google maps api group.  It discusses a problem with google maps in a MODx site that had problems in IE (not IE7).  It also gives a solution.
http://groups.google.com/group/Google-Maps-API/browse_frm/thread/1e43b088c9d10adb/e57637772553106b?lnk=gst&q=modx&rnum=1#e57637772553106b
joe

#34: 2-Nov-2006, 02:42 PM

luntereiner
Posts: 6

WWW
I have a problem with GoogleMapMarker… I've made all steps listed in the instructions (minus ditto, but not necessary ?). The map appear but not the marker. I have a folder (id=38) with two markers inside with the coords in the desc. field.

To pass this bug, I've hardcoded the snippet with (for debugging):

//
var point = new GLatLng(49.228024,6.006603);
var marker = createMarker(point, "CDPI", "CDPI<br /><br /><img width=118 height=74 src=http://www.netguru.fi/modx/assets/images/logo.png alt= />");
map.addOverlay(marker);

and the marker is naturally here, but not the link in the linksDiv.

Any Idea ?

http://www.immocdpi.com/

#35: 2-Nov-2006, 03:59 PM

Coding Team

doze
Posts: 4,111

....Boom!

I've made all steps listed in the instructions (minus ditto, but not necessary ?).
Are you saying that you don't have Ditto installed? It is necessary for GoogleMapMarker to work.
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#36: 2-Nov-2006, 04:10 PM

luntereiner
Posts: 6

WWW
Oops! I didn't see that in the instructions… or it's my poor english,  so let's go… again!

thx Doze.

#37: 2-Nov-2006, 04:17 PM

Coding Team

doze
Posts: 4,111

....Boom!

Oh, sorry about that, I was sure I had written that to the instructions.. It's there now.

EDIT: found it, I had only put the note in the snippet code header..
New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#38: 13-Nov-2006, 08:08 AM

JoeP
Posts: 65

I've made all steps listed in the instructions (minus ditto, but not necessary ?).
Are you saying that you don't have Ditto installed? It is necessary for GoogleMapMarker to work.

When you say ditto has to be installed do you mean that it has to be installed in MODx so that it shows up in the available snippet list or is something more required?
I'm not sure what I did, but I managed to make the markers not show up at all Sad
ditto was installed with MODx (0.95) when MODx was installed.
I made sure and unpublished the marker files and parent.
everything is set to non-cachable.
I tried making the marker description with and without RTE.
It appears that the marker does not show up in the rendered html at all.

Any ideas?
Thanks,
joe

#39: 13-Nov-2006, 11:01 AM

Coding Team

doze
Posts: 4,111

....Boom!

The ditto parameter names may have changed and causes the snippet to not be run correctly.

At line 318 you see:
Code:
$modx->runSnippet($dittoName,array('descendentDepth' => $descendentDepth, 'sortBy' => $sortBy, 'sortDir' => $sortDir, 'summarize' => 'all', 'displayArchive' => '0', 'tpl' => $dittoChunk, 'startID' => $startID, 'showPublishedOnly' => '0', 'trunc' => '0'));

Make sure by comparing to your Ditto snippet parameters that the names are the same.. I think that descendentDepth has atleast changed to just depth.. Maybe changing that helps. But if it doesn't check the other parameter names too and report back please!

New MODx wiki! Please help up with documentation efforts! || Old Wiki

"He can have a lollipop any time he wants to. That's what it means to be a programmer."

#40: 13-Nov-2006, 06:25 PM

JoeP
Posts: 65

The ditto parameter names may have changed and causes the snippet to not be run correctly.

At line 318 you see:
Code:
$modx->runSnippet($dittoName,array('descendentDepth' => $descendentDepth, 'sortBy' => $sortBy, 'sortDir' => $sortDir, 'summarize' => 'all', 'displayArchive' => '0', 'tpl' => $dittoChunk, 'startID' => $startID, 'showPublishedOnly' => '0', 'trunc' => '0'));

Make sure by comparing to your Ditto snippet parameters that the names are the same.. I think that descendentDepth has atleast changed to just depth.. Maybe changing that helps. But if it doesn't check the other parameter names too and report back please!
Quote

According to the ditto 1.02 documentation at http://modxcms.com/ditto_parameters.html
the parameters descendentDepth, sortBy sortDir, showPublishedOnly, and trunc are valid.

code for each appears to be present in the ditto 1.02 snippet code... such as:
$descendentDepth = (isset($descendentDepth))? $descendentDepth : 10;
   // number of levels deep to go


I found the problem(s)... Apparently in my attempts to make fancy marker lables I had both used an RTE which intrduced a second line, and I had published the marker page.  Once I got ride of the editor, removed all but one line, and un-published the page, it seems to be working agin.

Feature Request:  Support for multi-line HTML in the content so that more complicated html markers do not have to be written, or re-formatted, onto a single line.

Thanks very much for both the snippet and quic responses to support requests!
joe
« Last Edit: 13-Nov-2006, 06:38 PM by JoeP »
Pages: 1 [2] 3 4 ... 11   Go Up
0 Members and 1 Guest are viewing this topic.