2

For years ago I had a hard time to do the google map with marks for my web. I am impolanting ssl for paypal and I just checked and see the map does not work with htts: so I entered google map for a solution and saw that the javascript has been deprectated and they recomend to upgrade to version3. Is there an easy way to do or some tutorial, as I am so busy trying to integrate paypal and it was not easy the last time. Any tips?

This is how I have the map:

function createMarker(point,html) {
    var marker = new GMarker(point);
    GEvent.addListener(marker, "click", enter code herefunction() {
      marker.openInfoWindowHtml(html);
    });
    return marker;
  }

  // Display the map, with some controls and set the initial location 
  var map = new GMap2(document.getElementById("map"));
  map.addControl(new GLargeMapControl());
  map.addControl(new GMapTypeControl());
  map.setCenter(new GLatLng(36.51308543049258, -4.886341094970703), 13);

  // Set up three markers with info windows  

  var point = new GLatLng(36.50856685143835, -4.866085052490234);
  var marker = createMarker(point,'<div style="width:240px">Text here<a href="link here">Link<\/a><\/div>')
  map.addOverlay(marker);

Thanks

j0k
  • 22,600
  • 28
  • 79
  • 90
helenp
  • 21
  • 2

1 Answers1

1

Use the v2 reference and the migration table to create a text file:

v2                v3
GMap2             google.maps.Map
GLatLng           google.maps.LatLng
GInfoWindow       google.maps.InfoWindow
GMapOptions       google.map.MapOptions
G_API_VERSION     google.maps.version
GPolyStyleOptions google.maps.PolygonOptions or google.maps.PolylineOptions

then run find/replace in one way or another:

   for func in `cat deprecated.txt`
     do
      grep -R $func /path/to/src
   done

References

Community
  • 1
  • 1
Paul Sweatte
  • 24,148
  • 7
  • 127
  • 265