Magnification problem when node ref marker added

jupiterchild - July 30, 2008 - 08:11
Project:GMap Addons
Version:5.x-1.x-dev
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

I finally figured how to use CCK Node Reference to add a marker to a CCK Google Map View but have noticed this problem:

If I add a CCK node reference marker to an existing CCK gmap view, then save the edited node, the selected magnification for that map is lost and the default magnification is displayed.

#1

jupiterchild - July 30, 2008 - 08:17

I should add that the gmap is inside a collapsible fieldset.

#2

jupiterchild - July 31, 2008 - 07:28

Changed the CCK gmap view display from 'collapsible fieldset' to 'no styling' but the problem remains.

#3

najibx - September 10, 2008 - 16:28

hi, how do you use 'CCK Node Reference to add a marker to a CCK Google Map" in the first place? When editing a node with this gmap cck, can you see the map and click to add marker? Double click to remove it, just like in the macro or gmap/location?

I have the gmap inside a tab (cck field group tab), the magnification is kept fine. But ... I need the marker to be there as well. Do you think location/gmap would be easier alternative?

#4

jupiterchild - September 17, 2008 - 08:44

This is how I did it:

I will assume you already have Gmap and Location installed and enabled.

Install and enable CCK Gmap module (part of Gmap_Addons)
Install and enable CCK Node Reference module.
In admin >> content >> types >> your content type

1) add a new field of the type Google Map View.
e.g.
Label > Google Map
Name > field_google_map
Type > Google map view

Configure the settings as appropriate.

2) add a new field of the type Node Reference
e.g.
Label > Map Marker
Name > field_map_marker
Type > Node Reference

Configure the settings as appropriate making sure you check your content type under 'Content types that can be referenced:'

Suggestion for 'Widget' setting: If you have a lot of nodes I find it easier to use 'Autocomplete Text Field'

3) From the 'Operations' column for the 'Google map view' field you created at step 1) select 'Configure' and open the configuration page for the 'field_google_map'

At the bottom of the configuration page you will now see a setting for 'Marker noderef:' in the box add your Node Reference without the field prefix
e.g. map_marker NOT field_map_marker

4) Now set appropriate Display settings for 'your content type'
I prefer to create a group and add the two fields you created at 1) and 2) then display the map in a collapsed fieldset.
e.g. create a group 'Location Map' and add the 2 fields created at 1) and 2)

5) Create a node for your content type (I will assume you have enabled the gmap filter etc. for your 'Content type') give it a 'Title' and SAVE the node.

Edit the node you just created and you should now see a form for 'Location Map' or whatever you called the group you created at 4).

In 'The Latitude and Longitude of the centre of the map:' field add your Lat/Lon coordinates
e.g. 53.489121,-1.669344

In the 'Map Marker:' field or whatever you called the field created at 2)
add the node reference e.g. the title of the node (easiest way is just to copy and paste the node title).
The 'Auto complete' box will find the title. Select the title and 'Auto complete' will add on the node reference to the end of the title
e.g.
Your node title [nid:6467]

Note: in the node edit page the marker will not show on the Google map.

Save the node and the marker should now appear on the Google Map.

Change the marker style in the appropriate Gmap settings form.

Hope this helps.

#5

najibx - September 17, 2008 - 14:39

thanks ! I haven't tried it, but if you had a success, should consider put it up in the handbook. Do you have a live site, I can view?

I also has tried the location support for cck. No need for node ref. simpler. I just can't get it to display. It just showing the coordinate. the field (lat/long) was not showing in contemplate either. Hmm ..of course, this is a different issue already.

For now, I am just using the location as a field, not cck field.

#6

jupiterchild - September 17, 2008 - 15:27

najibx

http://neiljacklin.com/cms/travelog will take you to the front page:

Open a full node and you will see the Location Map

There is also an example of Trackfield Module in some of the nodes if you open Route Map

or try this:

http://neiljacklin.com/cms/2008/08/31/uk/south-yorkshire/langsett/hingcl...

#7

jupiterchild - September 17, 2008 - 15:37

najibx

Try the instructions at #4. If you find them useful or can improve upon them and of course if they enable you to create the marker for the node map then we can add them to the handbook.

 
 

Drupal is a registered trademark of Dries Buytaert.