Grant, I tried that and it would exclude ones that did not meet the conditional but when one did match it would output with the word FALSE instead of the field name. And because FALSE is a non valid shortname for anything it would show up in the output:
{if FALSE !=""} stuff here {/if}
I tried several variants including:
{field_name_raw}{if longitude != ""}{longitute} {latitude}{/if}{/field_name_raw}
All got me the same results.. it kept returning FALSE in my conditional.
I’m sorry if I missed it in the thread, but is it possible to output one map with several points on it? For example, if I have ten weblog entries, all with their own Geo points, can I output a single map that displays all those points? Or, is this simply a one map per entry kind of thing?
This is a very cool extension, kudos!
It is cool but I am wondering how easy it is to dumb down. I have custom address fields already and would like to simply use those, that way the person entering does not have to jump to another field and enter the address in again. The way I was thinking is to have the processing of the geocoding like this.
Mark’s geo field basically becomes an entry spot for the custom fields you want to process per custom field group seperated by commas. So if you have (local_address, local_city, local_state) fields you would enter in Mark’s field (local_address, local_city, local_state) as default when creating the geo field, so no map just the field. Then it’s easier to use in SAEF with your own custom fields and assign them to run through that field. It would just take those fields you specify and run the geocoding with Mark’s extension, everything else as normal.
Am I thinking in the right direction, it’s bascially a whole new extension built on Mark’s code but Mark would have to modify it after all it’s his extension to do so. I am more an ideas guy and know enough PHP to blow up a cake:)
arty, I used this extension a while back and I’m pretty sure I experienced a similar problem…Instead of using the extension tags to generate the code, you might want to just hardcode it and include the zoom manually.
For the map.setCenter change the number 7 at the end to your required zoom level.
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(43.670906, -79.393331),7);
Hmmmm….looks like the forum stripped some of the code.
I’ve uploaded a txt file with the code in it for you to paste..you can find it here
Just replace all the relevant weblog entry tags with your weblog names. Also, don’t for get to have the google maps api key in the head of your template. If you don’t have one, you can get one for your domain here: http://code.google.com/apis/maps/signup.html
Two questions:
(1) Is it possible to adjust the pin information on the map. Like specify it display an event and location name. So clicking on the pin you get a pop-up with something like: MyEvent; Union Square Plaza; 128 Main St., Chicago, IL, #####. So far my pin(s) aren’t displaying anything; also
(2) Is there an example of how to use the raw data to output multiple pins to a single map? Has anyone done this and are you willing to share?
Thanks
Yes, it is definitely possible. Firstly, you’ll need to add custom fields for each piece of info…(ie Location, Date, Time, Address, etc) …The way I was able to get this to work, was by hardcoding the entire google maps code, rather than using the one generated by the geocoding extension.
Once you do that, you can add the chunk of code for adding markers (you referred to them as pins) and basically just slap some {exp:weblog entries} tags in there to pull the location info from the custom fields you made.
It’d look something like this:
Don’t forget to append ‘_raw’ after the location field tag pair. Hope that helps
Create a template specifically for the Google map itself, and then you can embed that wherever you want…This template is where you’ll put the javascript for the Google mapo.
Here’s what you gotta do:
1) Create a template for the map 2) Copy/paste the code found here into your Google map template 3) In the <head> you’ll see the spot for your unique Google Api key…replace the text YOUR KEY HERE with the key that Google gives you 4) Replace the fields and weblog names with YOURS 5) Save this template as “gmap” or whatever and embed it wherever you need the map
Hope that helps
Hi adro. Thanks so much for your help. I have it almost working. I keep getting a rejection message from Google Maps about my API key. Which I don’t understand. I even generated a new key. But from what I can tell; the other code is working fine. I see the map points in the code, just no map because of the Google reject. So I’m working on that. May have to go to Google forums for it though, because the key worked with Phoogle.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.