Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-21 06:25:06

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

msd_google_map: Easily associate a location with your articles

Article Location Map

This plugin will add a Google map to your article tab to assist you with adding lat/lng coordinates to 2 custom fields. Just click on the desired point on the map to set the location or enter an address in the address field for geocoding.

You must set the Google Maps API key for your domain in the Article Location Preferences tab. An API key can be obtained at Google Maps

Screen shot and usage example

Thanks to duchamp for the initial idea as well as to the great Textpattern community and plugin developers for their inspiration.

Download msd_google_map
  • v1.1 – added customizable Marker using mapiconmaker.js
  • v1.2 – added support for TXP 4.0.6 thanks to a tip from jm
  • v1.3 – added GUnload() to prevent browser memory leaks per Google Documentation.
  • v1.4 – updated help.
  • v1.5 – fixed map zoom setting.
  • v1.6 – added initial zoom setting
  • v1.7 – added MLP Pack code from netcarving.com
  • v1.8 – added colorpicker to preferences tab if msd_admin_colorpicker is also installed.
  • v2.0 – refactored javascript injection to work with future versions of Textpattern
  • v2.0.1 – fix (i hope) Geocoder Lookup.
  • v2.0.2 – fix url to js for multisite install.
  • v2.0.3 – fix error in IE when trying to add onunload event of GUNLOAD.

Last edited by MattD (2011-08-17 22:11:19)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#2 2009-04-21 08:28:47

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: msd_google_map: Easily associate a location with your articles

Great work Matt!
This plugin just gets better and better!

how about placing a starting Zoom option also? in googlemaps you can edit this:

$replace2.='map.setCenter(mypoint,14);'."\n";

14 is the zoom, it can be anything from 0 to 19

Thanks for this great plugin!

Last edited by mlarino (2009-04-21 08:29:52)

Offline

#3 2009-04-21 08:53:43

candyman
Member
From: Italy
Registered: 2006-08-08
Posts: 684

Re: msd_google_map: Easily associate a location with your articles

Great. Dot.

Offline

#4 2009-04-21 11:05:44

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: msd_google_map: Easily associate a location with your articles

Awesome Matt!
Thanks for turning that “initial idea” into this plugin!

Do you think it’s possible to put more than one location in just one map?

Eg.: City map with lots of locations

Thx

Offline

#5 2009-04-21 15:56:23

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: msd_google_map: Easily associate a location with your articles

mlarino wrote:

how about placing a starting Zoom option also?

There are actually two different zoom settings. One for if there is already location data in the article and the other for if there isn’t.

Currently the starting zoom level for a blank map is 14 and the starting point for a map with a marker is 1.

You want the ability to change them both?

Last edited by MattD (2009-04-21 15:56:47)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#6 2009-04-21 15:57:46

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: msd_google_map: Easily associate a location with your articles

duchamp wrote:

Awesome Matt!
Thanks for turning that “initial idea” into this plugin!

Do you think it’s possible to put more than one location in just one map?

Eg.: City map with lots of locations

Thx

How do you imagine this working? I’m not sure how we’d store mutiple points using just custom fields.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#7 2009-04-21 16:04:37

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: msd_google_map: Easily associate a location with your articles

mmmmm
I guess you are right

I just changed it so that when you have no adress the map starts with a view of the street my client is located, but you are right, not really necesary, but easy to make.

Do you see a way to change the icon?
I am looking into rss_google_map also but doesnt support that either, I think both plugins can benefit from that.
At least is something I am researching now that I really need to have in my maps.

Offline

#8 2009-04-21 16:04:51

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: msd_google_map: Easily associate a location with your articles

MattD wrote:

How do you imagine this working? I’m not sure how we’d store mutiple points using just custom fields.

To be honest … no idea! :)

Maybe using a dropdown menu to choose in wich custom field we want to place the location, but not sure, I haven’t so much time actually to look into this (hope to have some time in a near future!)

Last edited by duchamp (2009-04-21 16:07:37)

Offline

#9 2009-04-21 16:19:44

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: msd_google_map: Easily associate a location with your articles

mlarino wrote:

Do you see a way to change the icon?
I am looking into rss_google_map also but doesnt support that either, I think both plugins can benefit from that.
At least is something I am researching now that I really need to have in my maps.

The API allows you to set an icon image and icon shadow image but then you get into tons of settings
I’ll have to look at it more when I have more time.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#10 2009-04-21 16:24:29

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: msd_google_map: Easily associate a location with your articles

mlarino wrote:

Do you see a way to change the icon?

Do you mean the marker? (the red one). Just google for “google map custom marker”.

MattD wrote:

How do you imagine this working? I’m not sure how we’d store mutiple points using just custom fields.

I would keep: 1 location = 1 article.
Then, on an article list context (a special section), I would iterate over all the location articles, picking up the two custom fields for each article, and render them on a single Google map.

But I’m just thinking out loud.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#11 2009-04-21 16:29:13

duchamp
Member
From: Patagonia
Registered: 2005-02-03
Posts: 222
Website

Re: msd_google_map: Easily associate a location with your articles

maniqui wrote:

I would keep: 1 location = 1 article.
Then, on an article list context (a special section), I would iterate over all the location articles, picking up the two custom fields for each article, and render them on a single Google map.

I second that idea!

Offline

#12 2009-04-21 16:39:36

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: msd_google_map: Easily associate a location with your articles

^^ :)
Although I’m not using this plugin, I think this functionality is outside of this plugin scope, right?
I mean, the plugin is just for populate lat/long values into two custom fields.
Then, it’s up to you how you use this values on the front side.

In other words, there is “nothing” else this plugin could do (right now) to help on the task of creating a map with many markers. The plugin already does all you need (I think).


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB