Current status of the Ning Platform is always available on the Ning Status Blog.

FORUM

NC for Hire

Ok so someone I am helping with their Ning community has a lot of locations which are mentioned throughout their site and they were wondering how we could change those locations into maps automatically.  I am going to show you how to do two things like this..  First how to change an address into a link to google maps automatically and second, how to convert mentions of a location into an autogenerated map.

It'll look something like this

Ok so say you or your members add a bit of HTML to a post like this:

<br>
Automatically Generated Google Maps link:
<address class="link">
30 Rockafeller plaza
<br>
New York, NY 10112
</address>
<br>
Automatically Generated Embedded Google Map:
<address class="map">
30 Rockafeller plaza, New York NY 10112
</address>

After you add the following snippet of jquery code to your Custom Code (bottom).....

<script>

//Generate a link to google maps
x$(document).ready(function () {
//Convert address tags to google map links
x$('address.link').each(function () {
var link = "<a href='https://maps.google.com/maps?q=" + encodeURIComponent( x$(this).text() ) + "' target='_blank'>" + x$(this).html() + "</a>";
x$(this).html(link);
});
});

///Generate a google embeded map
x$(document).ready(function(){
//Convert address tags to google embedded map
x$("address.map").each(function(){
var embed ="<iframe width='425' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='https://maps.google.com/maps?&amp;q="+ encodeURIComponent( $(this).text() ) +"&amp;output=embed'></iframe>";
x$(this).html(embed);

});
});

 

</script>

 

Whenever anyone on your site wraps their location text inside either  of the two following HTML brackets, it will generate a map:

<address class="link">  LOCATION </address>

 

or

 

<address class="map">  LOCATION  </address>

 

Do you find this to be useful? Let me know..

You need to be a member of Ning Creators Social Network to add comments!

Join Ning Creators Social Network

Email me when people reply –

Replies

  • NC for Hire

    Honestly this is one of the best tips I ever added to this community... I am surprised more creators are not using it!

This reply was deleted.

Announcements

 

Some interesting articles related to community management, digital marketing etc. could be found in our digest. Don't hesitate to leave a feedback so we would know that we should continue :-)

Latest Activity

This Is bully replied to Ceddy J's discussion
Disk Usage Enforcement
"It’s just business "
1 hour ago
Susan commented on Steve C's blog post To Ning's CEO
"Steve, I'm interested in the answer NING surely sent to you....
Thanks"
1 hour ago
Alastair Price, Jessica Meakin, Corey A Jackson and 4 more joined Ning Creators Social Network
2 hours ago
Ceddy J posted a discussion
Today I received an unsettling email regarding disk usage on my site. Not only did they say Inwent…
4 hours ago
J.Ayvar left a comment on Ning Networks en español
"Hola! Alguien ha construido una versión de Ning. 4? Yo ya cree mi sitio web en la última versión.…"
15 hours ago
José Luis Cuendia replied to Victoria_NING's discussion
Let’s recall the Q2: what was achieved
"As the creator of a network of photographers, all its members are very angry, how one of the most n…"
yesterday
J.Ayvar replied to Amber Nelson's discussion
Off Topic Rant - Self Hosted - The Good, the Bad And The Infuriating
"I have been a customer for 12 years ago. 
What can we say? We have never lost confidence in your pr…"
yesterday
J.Ayvar replied to J.Ayvar's discussion
Ning 4. PageSpeed Insights Vs Ning 3

One of the reasons why our projects decreased in the search ranking was the speed
Today the devel…"
yesterday
Steve C posted a discussion
I want to have preset forum discussion searches on my Ning 2 network so members can go to search re…
yesterday
Steve C replied to Amber Nelson's discussion
Off Topic Rant - Self Hosted - The Good, the Bad And The Infuriating
"Agreed, Amber! I love Ning. It just needs to catch up technology wise but it's one thing I don't ha…"
yesterday
Steve C replied to J.Ayvar's discussion
Ning 4. PageSpeed Insights Vs Ning 3
" Speed is the reason I haven't moved to Ning 3 yet. Ning 2 is so much faster; not as fast as I'd li…"
yesterday
José Luis Cuendia left a comment on Ning Networks en español
"Tengo una red social de fotógrafos www.moldeandolaluz.com y es lamentable que haya desparaecido el…"
yesterday
More…

Meanwhile, you can check our social media channels