I have gotten as far as posting a map within a node following bdragon's steps. My question is where/how can I create markers for the map.
I have a non-drupal database where I have longitude and latitude coordinates stored. I have no problem switching databases and querying them with php, but I don't know where to do this for gmap.
Do I need to write a node module? Should this be done in the node.tpl.php?
Any help, a point in the right direction would be greatly appreciated.
Thanks!
Comments
Comment #1
bdragon commentedAre you using a map array or a macro so far?
Paste what you have and I'll make suggestions..
Comment #2
mdcook commentedI made CCK type called dataMap and inserted the macro code in the body. So all that is being displayed is an empty map.
This is for a genetic research website and the map is going to allow users to view where samples where collected. The map array sounds like the right direction though. Mainly because I need to populate the markers each time the map is loaded since they will change every time a researcher submits new sequence data.
If I use the map array, do populate that in the tpl.php file or do I need to write and node module?
Comment #3
mdcook commentedI am reading the api for the map array and plan on using that within the page-node-[].tpl.php file. I think this is the right move?
Comment #4
rooby commentedThis is pretty old now so I'm sure you have found a solution of some sort but:
If you can import the data into your drupal database that would be a good option.
Otherwise you could try using the php input format (enable the gmap input filter for it) for your body field.
Then put all your php db querying code in the body and make the php print out the gmap macro with your marker lat/lon coords in it.
If you don't want code embeded in nodes or you don't want the page to be a node page you could writer a module that creates a page and in the page print out the map by creating the macro and using the gmap_parse_macro($macro_text) function followed by theme('gmap', $map_array)
I am closing this issue because it is so old but if you need more help with this just reopen it.