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

Sir Gissachance replied to Anastasia_Ning_Support's discussion
Welcome Landing Page Builder
"Dear Ning,
We have only just got around to spending some time exploring the landing page builder bu…"
17 hours ago
Wullie Steele replied to Kyryl_Ning_Support's discussion
Changes on facebook, and new instructions how the app should be set up
"What really gets me is the out of date instructions built in to the network's members sign up/sign…"
21 hours ago
Gavin Brown replied to Kyryl_Ning_Support's discussion
Changes on facebook, and new instructions how the app should be set up
"Despite many back and forth conversations about this and assurances from Ning staff that it is work…"
22 hours ago
Wullie Steele replied to Kyryl_Ning_Support's discussion
Changes on facebook, and new instructions how the app should be set up
"Just wasted nearly two full days following the old out of date information provided via the sign up…"
22 hours ago
Anam replied to Steve C's discussion
Comparing Speeds of Ning 2 and Ning 3 Sites
"Hi Anastasia, I sent you a PM. I think your response perhaps indicates that some others are having…"
yesterday
Anastasia_Ning_Support replied to Steve C's discussion
Comparing Speeds of Ning 2 and Ning 3 Sites
"Hello Anam! 
I apologize for the inconveniences!
We are currently looking into loading speed compla…"
yesterday
chienella peter, Tracy McLaughlin, Sherry Blatchley and 14 more joined Ning Creators Social Network
yesterday
Hugh replied to Hugh's discussion
Support So Bad - Even the Support System Now Broken
"By the way - I'm glad to be able to report that at least the support system has now been mended.
An…"
yesterday
Hugh replied to Hugh's discussion
Support So Bad - Even the Support System Now Broken
"Thanks Anastasia. If it would makes things zip along any quicker, I can happily live without insigh…"
yesterday
Helela replied to Hugh's discussion
Support So Bad - Even the Support System Now Broken
"They are nice.. But for four years I've been off or things going wrong since I've opened my site a…"
yesterday
Helela and Ron are now friends
NC for Hire
yesterday
Steve C replied to Hugh's discussion
Support So Bad - Even the Support System Now Broken
"Even though only email support comes with my $60 plan, I call support if I need to and I've never b…"
yesterday
More…

Meanwhile, you can check our social media channels