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

  • SEARCH
  • Home
  • 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 6709879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:56:04+00:00 2026-05-26T07:56:04+00:00

im trying to create a google marker manager but get the error message marker

  • 0

im trying to create a google marker manager but get the error message marker is not defined, ive commented out the code that is causing the problem, i have it set to user clicking on the map and places a marker, i want it to be able to do this automatically appearing on the google map using the GOOGLE MARKER MANAGER

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<div id="map_canvas" style="width:500px; height:500px;"></div>

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true">

</script>


    <script type="text/javascript">

        var map;
        var counter;
        var latlng;
        var locationAddress;
        var geocoder;
        function initialize() {
            geocoder = new google.maps.Geocoder();
            latlng = new google.maps.LatLng(46.043830, 14.488864);
            var myOptions = {
                zoom: 16,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
            counter = 0;

            google.maps.event.addListener(map, 'click', function (event) {
                map.setCenter(event.latlng);
                placeMarker(event.latLng);

            });


        }

        function placeMarker(location) {
            var clickedLocation = new google.maps.LatLng(location);
            latlng = location;
            var marker = new google.maps.Marker({
                position: location,
                map: map
            });
            codeLatLng(location, marker);
        }

        function addLocationInfo(marker) {
            var infoWindow = new google.maps.InfoWindow({ content: locationAddress, size: new google.maps.Size(50, 50) });
            google.maps.event.addListener(marker, 'click', function () {
                infoWindow.open(map, marker);
            });
        }

        function codeLatLng(latlng, marker) {
            if (geocoder) {
                geocoder.geocode({ 'latLng': latlng }, function (results, status) {
                    if (status == google.maps.GeocoderStatus.OK) {
                        if (results[1]) {
                            locationAddress = results[1].formatted_address;
                        }
                    } else {
                        locationAddress = "Neznan naslov";
                    }
                    addLocationInfo(marker);
                });
            }
        }

//        // Create a new instance of the MarkerManager
//        var mgr = new MarkerManager(map);
//        // Create marker array
//        var markers = [];
//        // Loop to create markers and adding them to the MarkerManager
//        for (var i = 0; i < 50; i += 0.1) {
//            var marker = new GMarker(new GLatLng(59.0 + i, 13.80 + i));
//            markers.push(marker);
//        }
//        // Add the array to the MarkerManager
//        mgr.addMarkers(markers);
//        // Refresh the MarkerManager to make the markers appear on the map
//        mgr.refresh();

        $(document).ready(function () {
            initialize();
        });

    </script>

Error Message: MarkerManager is not defined

  • 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-26T07:56:04+00:00Added an answer on May 26, 2026 at 7:56 am

    You’re mixing up Google Maps API 2 and API 3 code.
    Remove the v=2 parameter or change it to v=3 (or v=3.5 for instance).

    Change this:
    sensor=truese
    to either
    sensor=true or sensor=false

    Remove the API key, that’s only required for API 2.

    Get rid of all the GMap2, GLatLng type of code that is for API 2 and change it all to be in API 3 syntax.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to create a new google custom search engine, but when
I'm trying to create an application that uses the iPhone MapView (under Google Code).
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation
I'm trying to create a dynamic ItemizedOverylay (please see the code below) on Google
I am trying to create an interface to the swfobject found at http://code.google.com/p/swfobject/ .
I am trying to create a Google Map with a single coordinate as marker.
I am trying to create Google Chrome extension that will send interesting links to
I am trying to create a website where I host my data on google
Trying to create a user account in a test. But getting a Object reference
I am trying to create a Google Map where the user can plot the

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.