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!

  • NC for Hire

    so glad  i had this backed up...

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

⚡JFarrow⌁ replied to Anastasia_Ning_Support's discussion
What’s new on NING?
"Yes.... i don't see the search features enabled for my site.. it shows on Videos but not photos, fo…"
3 hours ago
Dr Husky (Emalejandro) replied to Dr Husky (Emalejandro)'s discussion
I need upload ads.txt
"Very very thanks :)"
6 hours ago
Anastasia_Ning_Support replied to Anastasia_Ning_Support's discussion
What’s new on NING?
"Hello!
This update will bring the "Add content" button only for single type content module, but in…"
9 hours ago
Anastasia_Ning_Support replied to Anam's discussion
Comments on Profile Pages Do Not Appear in Latest Activity
"Hello Anam!
You are completely right, such functionality may possibly cause issues to the network o…"
9 hours ago
Anastasia_Ning_Support replied to Dr Husky (Emalejandro)'s discussion
I need upload ads.txt
"Hi!
Here is the link to edit your ads.txt https://revistadiscover.com/main/admin/adsTxt
Best regard…"
9 hours ago
Anastasia_Ning_Support replied to Anastasia_Ning_Support's discussion
What’s new on NING?
"Hello!
Only the "Add content" button was scheduled for release this week, the other 2 updates were…"
9 hours ago
Anastasia_Ning_Support replied to Anastasia_Ning_Support's discussion
What’s new on NING?
"Hello Rachella!
We will definitely bring a mobile application at some point, but I am afraid it wil…"
9 hours ago
⚡JFarrow⌁ replied to Anastasia_Ning_Support's discussion
What’s new on NING?
"me too"
10 hours ago
Yvette Vega, Robin Stewart, Cynthia Wilson and 2 more joined Ning Creators Social Network
12 hours ago
Rachella Sinclair replied to Brandyn Shepherd's discussion
NING - Mobile App!
"I seriously need this!!! Will most likely leave Ning if they don't get their act together on this f…"
Saturday
Rachella Sinclair replied to Anastasia_Ning_Support's discussion
What’s new on NING?
"Any chance of getting a mobile app anytime soon? I've got heavy competition and they're all app-bas…"
Saturday
Fernando Bisbal posted discussions
Saturday
More…

Meanwhile, you can check our social media channels