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 8043209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:49:54+00:00 2026-06-05T04:49:54+00:00

I am trying to port my google api v2 to v3 but it does

  • 0

I am trying to port my google api v2 to v3 but it does not work….i get an “Polyline is not defined” error… :/ the old Polyline is GPolyline and the new is new google.maps.Polyline

https://developers.google.com/maps/documentation/javascript/overlays?hl=de-DE#Polylines

var map = "";
var mapConfig = "";
var mapElements = "";
var curActiveMenuButton = "";
var clickHandlerElementCount = "";


//window.onload = function() {
//window.addEvent('domready', function() {
//document.addEvent('domready', function() {
//alert("The DOM is ready.");
//initializeMap();
//});

/* 
 * function initializeMap()
 * 
 * Initalisierung der Google-Map.
 */
function initializeMap(){

        // Karte ins DOM einhängen
        map = new google.maps.Map($('map_canvas'), myOptions);

        //place the map on the canvas
        //map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

        var latlng = new google.maps.LatLng(51.05758110879136, 10.451431274414062);

        // default zoomlevel and center point
        var myOptions = {
            zoom: 12,
            center: latlng,
            mapTypeId: google.maps.MapTypeId.ROADMAP, 
            navigationControl: true, 
            mapTypeControl: true, 
            scaleControl: true,
        };

        // default zoomlevel and center point
        var encodedPolyline = new google.maps.Polyline();

        // find bounding polyline and recalculate map center
        for (var i = 0; i < mapElements.length; i++) {
            if (mapElements[i]['titel'] == "nationalparkhainich") {
                    encodedPolyline = Polyline.fromEncoded({
                    points: mapElements[i]['pol'],
                    levels: mapElements[i]['lev']
                });
                mapCenter = encodedPolyline.getBounds().getCenter();
                i = mapElements.length;
            }
        }


        // Kartenmenue initialisieren
        //initializeMapMenue();

}
  • 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-06-05T04:49:56+00:00Added an answer on June 5, 2026 at 4:49 am

    Polyline is indeed not defined. You use it here:

    encodedPolyline = Polyline.fromEncoded({

    Version 3 doesn’t include fromEncoded() — it appears that you need to use the geometry library (which needs to be explicitly loaded separately) and

    encodedPolyline.setPath(
        google.maps.geometry.encoding.decodePath(mapElements[i]['pol'])
        );
    

    [split on to separate lines here for clarity]

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

Sidebar

Related Questions

I'm trying to get php mailer to work. I'm getting an error but couldn't
We are trying to port our code from HPX to AIX but getting core
I am trying to port the code below to mootools 1.1 code but am
I'm trying to port a PHP example of an API integration to Javascript /
I'm trying to work with the phpwebsocket library at http://code.google.com/p/phpwebsocket/ I'm using the version
I'm trying to get the apns daemon at http://code.google.com/p/apnsd/ working, and am having problems
We can't seem to create a new spreadsheet per the Google Docs API. Our
I'm trying to open a connection to a webpage (e.g. www.google.com) via localhost, port
I'm trying to send out mail using Google's SMTP in combination with PHPMailer, but
I just started with TCPSockets. I am simply trying to get the google home

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.