Thanks Stephen for the clarification.
Sounds like an extension I might be able to use in the near future.
For now, our editors are grabbing the coordinates with the Minimap Sidebar extension for Firefox. It’s easy enough to use for our needs.
Again, thanks for everything!
Hi Deron,I’m currently using the CoolLocation extension on a site and it’s served the purpose but can be a little buggy at times. This looks like a good replacement, but I’m wondering if it’s possible to geocode a point on the map from the publish page from other custom fields. The way CoolLocation works is by using built in address custom fields (just basic text fields for address, city, state, zip) and taking that information and then plotting the latitude and longitude points on the map. Wondering if this does something similar or would I have to manually go into every single entry and pinpoint the address on the map manually?The short answer is no. The slightly longer, and much less depressing, answer is perhaps; it all depends on how CoolLocation stores the pin location. I confess that I never actually managed to get CL working (which is one of the things that drove me to build this extension in the first place) so I really don’t have any idea how it works behind the scenes. However, assuming that it stores the latitude and longitude in a format that can be easily retrieved from the database, it should be possible to write a script that does the conversion donkey-work. If you can provide some information on how CoolLocation stores its information, I’m happy to pitch in with some pointers on writing a conversion script. Hope that helps. Cheers, Stephen
Stephen,
Thanks for explaining. I’m not sure how CL stores the data. My experience is extremely limited with managing and manipulating the database. It’s not big deal. CL is serving the purpose right now, but if I ever decide to do a redesign/develop later I’ll probably revisit your addon.
Thanks!
@Todd
Sounds like an extension I might be able to use in the near future.
Good stuff.
For now, our editors are grabbing the coordinates with the Minimap Sidebar extension for Firefox. It’s easy enough to use for our needs.
Thanks for the link, I hadn’t seen that before.
@Deron
Thanks for explaining. I’m not sure how CL stores the data. My experience is extremely limited with managing and manipulating the database. It’s not big deal. CL is serving the purpose right now, but if I ever decide to do a redesign/develop later I’ll probably revisit your addon.
Well, if it ain’t broke… 😉
Cheers, Stephen
Hi Max,
It will be great if u add ‘map type’ support for CP - because google don’t have all city on the map at this moment, so sometime needs to put point manually by photo view
I’ll add it as an option. It’ll take a few days though, work is very busy at present.
Cheers, Stephen
Hey Stephen,
Just trying to get my map to display as satellite view by default and it doesn’t seem to want to work. Here is my template code, can you see anything odd with it?
{contact-map id="contact-map" class="contact-map" controls="map_type" map_types="satellite|hybrid|normal"}
{map}fallback content{/map}
{/contact-map}
It actually doesn’t even show the map types buttons to do the switching. Can you advise if I am doing something wrong? Thanks!
Please forgive my stupidity 😊 I realized at lunch that I had not updated the global_script.js file that I pulled out of the fieldtype folder. Thanks again!
Stephen,
Awesome extension. I checked in to this before, and discovered it is challenging, but: is there any way that your extension could be extended to accept custom fields for address, city, state, and zip, and then generate the map off of that information? This way, my clients only have to enter the addresses for their properties, not go to Google for each one and grab the longitude and latitude.
If you make a commercial version with this capability, I think it would sell well.
Ben
This way, my clients only have to enter the addresses for their properties, not go to Google for each one and grab the longitude and latitude.
You can do that using the Google Maps API… look into the geocoder.getLatLng() method. The first parameter is address, passed as {address} {street}, {city}, {state} {zip}.
Hmmm. I try to stay away from that stuff–it sends me down a rabbit hole. Seems like if it were simple (I only need to generate *links* to Google Maps, that it would already be part of an extension.
That’s even easier…you can generate the link like this:
http://maps.google.com/maps?q=151+W.+54th+Street+10019
Just put the address after q=, and make sure to use the find/replace plugin to replaces spaces with pluses.
I’ve been doing something similar, but without replacing spaces with pluses. However, some of my maps are coming out wrong. Could this be because I didn’t replace spaces w/pluses?
Yes, it could be. Here’s what I do (using my custom field names). If it doesn’t work for you shoot me a private message so we don’t clutter Stephen’s thread:
<a href="http://maps.google.com/maps?q={exp:replace">Map Link Here</a>
Hi Ben,
Going back to your original question:
is there any way that your extension could be extended to accept custom fields for address, city, state, and zip, and then generate the map off of that information? This way, my clients only have to enter the addresses for their properties, not go to Google for each one and grab the longitude and latitude.
There’s no way to automatically pull that information from “related” weblog fields at present.
Having said that, there’s also no need to go to Google to retrieve the latitude and longitude.
Just enter the address (ZIP code, street / city, whatever) in the “Find location” field below the map, click “Find It”, and the extension will do the rest for you. The find location form is displayed automatically in the Control Panel; if you’re using it in a SAEF, you’ll need to enable it with the edit=”yes” parameter.
Hope that helps.
Cheers, Stephen
I’m running into an issue with multiple maps on one page. It uses generates the same ID for both maps.
I tried setting the ID parameter using {entry_id} to differentiate, but that jumbles up the output.
Thoughts?
{cf_locations_map id="google-map" class="map" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
works normally,
And then setting with entry id
{cf_locations_map id="{entry_id}-google-map" class="map" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
That gave me the following output.
-google-map" class="map" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
<div id="field_id_211_container" class="sl-google-map">-google-map" class="map" controls="zoom|scale|overview" map="drag|click_zoom|scroll_zoom" pin="drag|center"}
This is the fallback content for users who cannot see the Google Map.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.