Automatically Generate a Google Address Link or Map

Size
2,069 Kb
Views
16,192

How do I make an automatically generate a google address link or map?

These scripts will automatically take the text of an address and turn it into a embeded google map or a link to a map. . What is a automatically generate a google address link or map? How do you make a automatically generate a google address link or map? This script and codes were developed by Michael Stursberg on 27 October 2022, Thursday.

Automatically Generate a Google Address Link or Map Previews

Automatically Generate a Google Address Link or Map - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Automatically Generate a Google Address Link or Map </title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <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> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Automatically Generate a Google Address Link or Map - Script Codes CSS Codes

body { font-family: sans-serif; text-align: center;
}

Automatically Generate a Google Address Link or Map - Script Codes JS Codes

//Generate a link to google maps
$(document).ready(function () { //Convert address tags to google map links $('address.link').each(function () { var link = "<a href='https://maps.google.com/maps?q=" + encodeURIComponent( $(this).text() ) + "' target='_blank'>" + $(this).html() + "</a>"; $(this).html(link); });
});
///Generate a google embeded map
$(document).ready(function(){
//Convert address tags to google embedded map $("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>"; $(this).html(embed); });
});
Automatically Generate a Google Address Link or Map - Script Codes
Automatically Generate a Google Address Link or Map - Script Codes
Home Page Home
Developer Michael Stursberg
Username thesturs
Uploaded October 27, 2022
Rating 3
Size 2,069 Kb
Views 16,192
Do you need developer help for Automatically Generate a Google Address Link or Map?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Michael Stursberg (thesturs) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!