Forum Moderators: open

Message Too Old, No Replies

Google Map Markers

         

blankmonkey

8:04 pm on Feb 3, 2015 (gmt 0)

10+ Year Member



Hello again all, you all have been so helpful in the past, I am thrilled to see everything here still going strong. I am a sysadmin, and don't deal with web much, but am happy to have you guys here :)

My web admin level is NEWB
I use a Linux host with apache. I think I have perl enabled, and maybe java also.

So my question is simple, and the keywords are such that google doesn't know how to help me. I would like to;
Add a google map (in a window perhaps) to my webpage. On the map I would like to add markers, with some hyperlink information. Like a restaurant, and then after clicking on the marker, have it directly take me to the http or have a popup with the http link.

Is this to complicated? I would think it would be just a call with some values.

What is "google map makers" the google product? Can I use this is some fashion? Google is getting super grabby about personal information, so if I can keep it in house I would prefer to, but would like to know my options.

Technicalbuddy

7:44 am on Feb 9, 2015 (gmt 0)



Hi Blankmonkey,

Here is the code :

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Map Marker</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script>
<script>
// This example displays a marker.

function initialize() {
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var mapOptions = {
zoom: 4,
center: myLatlng
};

var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

var contentString = '<a href="http://www.google.com" target="_blank">Restaurant</a>';

var infowindow = new google.maps.InfoWindow({
content: contentString
});

var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Uluru (Ayers Rock)'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}

google.maps.event.addDomListener(window, 'load', initialize);

</script>
</head>
<body>
<div id="map-canvas"></div>
</body>
</html>

Happy Coding!

blankmonkey

7:31 pm on Feb 9, 2015 (gmt 0)

10+ Year Member



WoW! Much more then I was hoping for! You rock. Let me see if I can play with it before I ask any questions :)

blankmonkey

11:29 pm on Feb 9, 2015 (gmt 0)

10+ Year Member



Having trouble adding a second point (up to 20-50) and putting this in a small (say 3-5 inch) window in an existing web page.

blankmonkey

5:00 pm on Feb 10, 2015 (gmt 0)

10+ Year Member



Its a secure page, so I cant give it out. But it is super simple, html. Think about a "hello world" page, with some gifs that have html links in them. The page has (now) no java/perl/anything. Only html and pics.

blankmonkey

6:32 pm on Feb 17, 2015 (gmt 0)

10+ Year Member



I think I am going to try to use Google, Fusion Tables for this. Ty for the help!