Draw google polyline with line width set in meters -


i noticed when draw polyline in google maps set it's width in pixels (strokewidth). there way set in metres instead?

unfortunately, don't know easy way this. api not appear have documentation on , assume feature unsupported.

one problem pixels represent different number of meters @ different zoom levels within api. dynamic quantity if zoom levels changed.

one option might compute width in pixels representing given number of meters given zoom level. that, have write own function based on scales of map @ each zoom level. data appear available here:

http://webhelp.esri.com/arcgisserver/9.3/java/index.htm#designing_overlay_gm_mve.htm

20 : 1128.497220 19 : 2256.994440 18 : 4513.988880 17 : 9027.977761 16 : 18055.955520 15 : 36111.911040 14 : 72223.822090 13 : 144447.644200 12 : 288895.288400 11 : 577790.576700 10 : 1155581.153000 9  : 2311162.307000 8  : 4622324.614000 7  : 9244649.227000 6  : 18489298.450000 5  : 36978596.910000 4  : 73957193.820000 3  : 147914387.600000 2  : 295828775.300000 1  : 591657550.500000 

you can set pixel value dynamically depending on meters trying represent , current zoom level.

there may still problem because pixel sizes generate, may not correspond screen pixel sizes, depending on how api deals screen dpi , resolution


Comments