Marker rotation

3,707 views
Skip to first unread message

Michel de Geofroy

unread,
Aug 28, 2011, 8:25:50 AM8/28/11
to google-map...@googlegroups.com
Hi is it possible to rotate custom marker image (33 degree for e.g.) on google maps? below is code we used but failed to give results ... when we rotate image white box appears in background and if png transparent image the image is messed up...:(

// Check the image type
if($atype == "jpeg") {$original = imagecreatefromjpeg($imgold) or die("Error opening original");}
else if($atype == "png") {$original = imagecreatefrompng($imgold) or die("Error opening original");}
else if($atype == "gif") {$original = imagecreatefromgif($imgold) or die("Error opening original");}
else {die("Invalid image type");}
// Process the image
$rotate = imagerotate($original, $node['pnc_logo_rotation'], -1, 0);
// Show it to us
if($atype == "jpeg") {imagejpeg($rotate, $imgnew) or die("Cant save image");}
else if($atype == "png") {imagepng($rotate, $imgnew) or die("Cant save image");}
else if($atype == "gif") {imagegif($rotate, $imgnew) or die("Cant save image");}
else {die("Invalid image type");}
// Clean up
imagedestroy($rotate); 
Image 2.png

Chris Broadfoot

unread,
Aug 29, 2011, 3:45:45 AM8/29/11
to google-map...@googlegroups.com
Hi Michel,

This is more of an issue with the image library you're using.

You may also want to experiment with using Canvas, SVG or VML to rotate images in the browser. You could implement this as an [OverlayView] to create a class like google.maps.Marker that also adds rotate capability.


--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-maps-js-api-v3/-/HvcH29M8PfwJ.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply all
Reply to author
Forward
0 new messages