Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6678189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:12:47+00:00 2026-05-26T04:12:47+00:00

I’m dabbling a bit with google maps and data presentation and was wondering if

  • 0

I’m dabbling a bit with google maps and data presentation and was wondering if it is possible to create a button on the map page to drop the markers.

I have no programming experience (I deal with SQL mainly) so any help appreciated – I have the following code taken from varying webistes:

<!DOCTYPE html> 
<html> 
<head> 
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> 
<style type="text/css"> 
  html { height: 100% } 
  body { height: 100%; margin: 0; padding: 0 } 
  #map_canvas { height: 100% } 
</style> 
<script type="text/javascript" 
    src="http://maps.googleapis.com/maps/api/js?sensor=false"> 
</script> 
<script type="text/javascript"> 

    // Standard google maps function 
    function initialize() { 
        var myLatlng = new google.maps.LatLng(52.469397,-3.208008);
        var myOptions = { 
            zoom: 8, 
            center: myLatlng, 
            mapTypeId: google.maps.MapTypeId.ROADMAP 
        } 
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 
        TestMarker(); 
    } 

    // Function for adding a marker to the page. 
    function addMarker(location) { 
        marker = new google.maps.Marker({ 
            position: location, 
            map: map,
    animation: google.maps.Animation.DROP  
        }); 
    } 

    // Testing the addMarker function 
    function TestMarker() { 
Marker1=new google.maps.LatLng(52.268000,-3.043000); addMarker(Marker1); 
Marker23=new google.maps.LatLng(51.524243,-3.193911); addMarker(Marker23); 
Marker24=new google.maps.LatLng(51.524243,-3.193911); addMarker(Marker24); 
Marker25=new google.maps.LatLng(51.524243,-3.193911); addMarker(Marker25); 
Marker26=new google.maps.LatLng(51.524243,-3.193911); addMarker(Marker26); 
Marker584=new google.maps.LatLng(51.747777,-3.500599); addMarker(Marker584); 
Marker585=new google.maps.LatLng(51.608871,-3.647570); addMarker(Marker585); 

    } 
</script> 
</head> 
<body onload="initialize()"> 


  <div id="map_canvas" style="border: 1px solid black; width: 500px; height: 400px;">map     div</div> 
<p style="margin-top: 5px"> 
  <button id="drop">Drop</button>  
</p> 

</body> 
</html>

Now this creates a button, but I can’t for the life of me work out how to link this back to my markers. I have found something here that I should be able to adapt but I just don’t have the knowhow.

My markers are defined by a sql query, but for now I would like to be able to simply feed in a list and get a drop button to drop them when I click on it.

Any help massively appreciated 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:12:48+00:00Added an answer on May 26, 2026 at 4:12 am

    Remove the call to TestMarker from your initialize function. Then just add an onclick attribute to your button:

      <button id="drop" onclick="TestMarker()">Drop</button>  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I want to construct a data frame in an Rcpp function, but when I
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.