Following code working:
function()
{
var Marker = new google.maps.Marker();
var MarkerOptions = {};
MarkerOptions.map = my_map;
MarkerOptions.position = new google.maps.LatLng(0,0);
MarkerOptions.animation = google.maps.Animation.DROP;
MarkerOptions.clickable = true;
MarkerOptions.cursor = 'pointer';
Marker.smallicon = [{
anchor:null,
origin:null,
scaledSize:null,
size:new google.maps.Size(20,32),
url:'http://maps.gstatic.com/mapfiles/markers2/marker_sprite.png'
}];
Marker.setOptions(MarkerOptions);
}
And after add this one line, console shooting full of errors
function()
{
var Marker = new google.maps.Marker();
var MarkerOptions = {};
MarkerOptions.map = way_map;
MarkerOptions.position = new google.maps.LatLng(0,0);
MarkerOptions.animation = google.maps.Animation.DROP;
MarkerOptions.clickable = true;
MarkerOptions.cursor = 'pointer';
Marker.smallicon = [{
anchor:null,
origin:null,
scaledSize:null,
size:new google.maps.Size(20,32),
url:'http://maps.gstatic.com/mapfiles/markers2/marker_sprite.png'
}];
Marker.setIcon(Marker.smallicon);
Marker.setOptions(MarkerOptions);
}
I don’t understand it more, it working with google.maps.MarkerImage but in reference is written
A structure representing a Marker icon or shadow image. This class is
deprecated in favor of Icon.
So i try to work with Icon, they have changed it from constructor to Object so was changed the model of calling.
Marker.smalliconcurrently is an array, not agoogle.maps.Iconuse either:
or let it be an object:
Note: you don’t need to set all options of a
google.maps.Icon, ommit the options that you dont want to set.