resize svg icon for google map marker -


I'm having trouble changing the icon size in Google Maps. I have a SVG file that makes it responsive.

In this way I call the STVG file

  MyGreenSVG = {url: 'greenFill.svg', size: new Google .maps.size (20, 35) };   

Property: Size does not change the size of my icon, but crop it only. The only way to change the width and height in my SVG file, and make it 2 versions. So I lose the interest of using svg ...

This is a preview of my SVG file:

     

I am also unable to resize using scale . I came to know that if I use the marker image then I can scale the SVG and it looks great, the way it is better than PNG, as far as it is smooth . I do not think this is a 'symbol' and if I am using the marker image.

  function initialize () {var mapOptions = {zoom: 4, center: new google.maps wave long (-25.363882, 131.044 9 22}}; Var map = new google.maps.Map (document.getElementById ('map-canvas'), map options); Var marker = new google.maps.marker ({status: map.getCenter (), icon: new google.maps.MarkerImage ('mouse / myIcon.svg', null, null, null, new google.maps.Size (200,200) )), Dragable: false, maps: map}); } Google.maps.event.addDomListener (window, 'load', start);   

I'm still looking for a better solution.

UPDATE (04/14/2015)

I found it on the docs

< / strong> The complex icons were defined as marker image objects. The icon object was added to the official version 3.10, and the marker image has been replaced with version 3.11. Icon object literal supports parameters similar to the marker image, so that you can easily convert a marker image to an icon by removing the constructor, wrapping the previous parameters of {}, and adding the names of each parameter. For example:

  image = new google.maps.MarkerImage (place.icon, new google.maps.size (71, 71), new google.maps.Point (0, 0), new google.maps.Point (17, 34), new google.maps.size (25, 25));   

becomes

  var image = {url: place.icon, size: new google.maps.size (71, 71), origins: The new Google.maps.Point (0, 0), anchor: new google.maps.Point (17, 34), scale size: new google.maps.size (25, 25)};   

I was playing with size and extended and I think it's like I size and scaledSize works fine if the graphic is cut if the size is smaller than small small size .

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -