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 –
 

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

Matthew Aukai Wright replied to Bizz ( John )'s discussion
How To Make Your Feature, Add, Edit Buttons At The Top Of Pages Stand Out Better (Updated 08/01/17)
"Hey there. How can I add a rainbow background picture to the buttons? "
3 hours ago
Suzie Nielsen replied to Rowald's discussion
Ning not GDPR compliant
"new Question same Topic... what if I remove google analytics altogether... that's all I use... coul…"
10 hours ago
⚡JFarrow⌁ commented on Rosas † Negras's blog post Bar Skysa into 3.0
"Yes, skysa works.... you'll want to put it inside the Custom Code Footer box in 3.0... hope this he…"
15 hours ago
Fabricio Giugni replied to Fabricio Giugni's discussion
Chat help
"Hi,
   The only problem is that I can not make it work even if there is lot's of people. No one get…"
16 hours ago
Thisisbully replied to Fabricio Giugni's discussion
Chat help
"on mobile the chat notifications do not show "
17 hours ago
Gavin Brown replied to Kyryl_Ning_Support's discussion
Changes on facebook, and new instructions how the app should be set up
"Thanks for replying Anastasia!"
19 hours ago
Anastasia_Ning_Support replied to Cindy Dean Mccoy's discussion
Trouble tickets just sitting there
"Hi there!
It is true, that in terms of updates and new features, we are focusing on 3.0 platform, b…"
22 hours ago
Anastasia_Ning_Support replied to Fabricio Giugni's discussion
Chat help
"Hi there!
Thank you for checking once again and clarifying. It was made intentionally to leave memb…"
22 hours ago
Matthew Aukai Wright replied to Fire-Tech's discussion
3.0 Tip: Leave Network Button
"how can I make the button rainbow? "
23 hours ago
Anastasia_Ning_Support replied to Fabricio Giugni's discussion
Add Photos location problem.
"Hi there!
No, unfortunately, it is not possible to do so. As an example, we have added such button…"
23 hours ago
Anastasia_Ning_Support replied to Kyryl_Ning_Support's discussion
Changes on facebook, and new instructions how the app should be set up
"Hi there!
Unfortunately no update yet, it`s still in process of solving. 
Best regards,
The NING Te…"
23 hours ago
Lady Shadow replied to Lady Shadow's discussion
my ning 3,0 i HAVE TO BEG ning TO FIX EACH DAY AND PAY 59
"Thanks checking it now"
23 hours ago
More…

Meanwhile, you can check our social media channels