the following code displays the zip regions incorrect. Why?
The regions of postal codes are moved to east and north
<code>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=true®ion=DE">
</script>
<script type="text/javascript">
function initialize() {
var latlng = new google.maps.LatLng(52.51029966,13.40693388);
var myOptions = {
zoom: 14,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new
google.maps.Map(document.getElementById("map_canvas"),
myOptions);
var marker = new google.maps.Marker({
position: latlng,
title:"Hello World!"
});
// To add the marker to the map, call setMap();
//marker.setMap(map);
//nun die plz gebiete
var triangleCoords1 = [
new google.maps.LatLng(52.51029966,13.40693388),
new google.maps.LatLng(52.51021191,13.40741448),
new google.maps.LatLng(52.51064679,13.40800776),
new google.maps.LatLng(52.51044843,13.40827272),
new google.maps.LatLng(52.51044087,13.40828604),
new google.maps.LatLng(52.51042179,13.40831376),
new google.maps.LatLng(52.51040271,13.4083422),
new google.maps.LatLng(52.51034547,13.40841204),
new google.maps.LatLng(52.51025394,13.40855316),
new google.maps.LatLng(52.50985722,13.40909856),
new google.maps.LatLng(52.50907134,13.41018972),
new google.maps.LatLng(52.50876237,13.41062352),
new google.maps.LatLng(52.50862881,13.41083448),
new google.maps.LatLng(52.50844953,13.41111564),
new google.maps.LatLng(52.50848391,13.41117684),
new google.maps.LatLng(52.50926592,13.41289044),
new google.maps.LatLng(52.50907134,13.41306792),
new google.maps.LatLng(52.50879666,13.41325296),
new google.maps.LatLng(52.50793842,13.41390996),
new google.maps.LatLng(52.50734325,13.4143362),
new google.maps.LatLng(52.50707244,13.41466992),
new google.maps.LatLng(52.50701142,13.41485784),
new google.maps.LatLng(52.50698091,13.4149428),
new google.maps.LatLng(52.50695418,13.41503136),
new google.maps.LatLng(52.50683592,13.41538992),
new google.maps.LatLng(52.50676725,13.41562176),
new google.maps.LatLng(52.50633237,13.416975),
new google.maps.LatLng(52.50630186,13.41704664),
new google.maps.LatLng(52.50690846,13.41756432),
new google.maps.LatLng(52.50705336,13.41754632),
new google.maps.LatLng(52.507206,13.4178678),
new google.maps.LatLng(52.50666807,13.41936108),
new google.maps.LatLng(52.50639339,13.420107),
new google.maps.LatLng(52.50632859,13.42029492),
new google.maps.LatLng(52.50625614,13.4204796),
new google.maps.LatLng(52.50612258,13.42085472),
new google.maps.LatLng(52.50478365,13.41976356),
new google.maps.LatLng(52.50460815,13.4179794),
new google.maps.LatLng(52.50393675,13.41792792),
new google.maps.LatLng(52.50369645,13.41850104),
new google.maps.LatLng(52.50358962,13.4190828),
new google.maps.LatLng(52.50181959,13.41769212),
new google.maps.LatLng(52.50184254,13.41688428),
new google.maps.LatLng(52.5017853,13.41599364),
new google.maps.LatLng(52.50085065,13.41533196),
new google.maps.LatLng(52.49997333,13.4160768),
new google.maps.LatLng(52.49768832,13.4156808),
new google.maps.LatLng(52.49818035,13.4120304),
new google.maps.LatLng(52.49842074,13.41020376),
new google.maps.LatLng(52.49854656,13.40928468),
new google.maps.LatLng(52.4986038,13.40883144),
new google.maps.LatLng(52.49863431,13.40859888),
new google.maps.LatLng(52.49877552,13.40757576),
new google.maps.LatLng(52.49903103,13.40486604),
new google.maps.LatLng(52.49940876,13.40259372),
new google.maps.LatLng(52.49967957,13.40106408),
new google.maps.LatLng(52.50004956,13.39902684),
new google.maps.LatLng(52.50013731,13.39755804),
new google.maps.LatLng(52.50001527,13.395483),
new google.maps.LatLng(52.50003048,13.39489368),
new google.maps.LatLng(52.49988936,13.3938522),
new google.maps.LatLng(52.50049974,13.39264404),
new google.maps.LatLng(52.50341034,13.39197912),
new google.maps.LatLng(52.50513078,13.39159284),
new google.maps.LatLng(52.50952152,13.38946056),
new google.maps.LatLng(52.50954438,13.38990588),
new google.maps.LatLng(52.50970836,13.39269156),
new google.maps.LatLng(52.50973509,13.39300332),
new google.maps.LatLng(52.50974274,13.3931664),
new google.maps.LatLng(52.50974652,13.393242),
new google.maps.LatLng(52.50974652,13.39325532),
new google.maps.LatLng(52.50974652,13.39328484),
new google.maps.LatLng(52.50975417,13.39331616),
new google.maps.LatLng(52.50979233,13.39395228),
new google.maps.LatLng(52.50986478,13.395213),
new google.maps.LatLng(52.51022721,13.4014968),
new google.maps.LatLng(52.51024629,13.40176392),
new google.maps.LatLng(52.51016619,13.40205372),
new google.maps.LatLng(52.51079178,13.40251452),
new google.maps.LatLng(52.51133727,13.40291016),
new google.maps.LatLng(52.5116043,13.40310672),
new google.maps.LatLng(52.51161195,13.40315064),
new google.maps.LatLng(52.51121523,13.4044056),
new google.maps.LatLng(52.51089096,13.4054424),
new google.maps.LatLng(52.51048281,13.40649036),
new google.maps.LatLng(52.5103569,13.40678988),
new google.maps.LatLng(52.51030731,13.40690328),
new google.maps.LatLng(52.51029966,13.40693388)
];
var triangleCoords2 = [
new google.maps.LatLng(52.51092912,13.432599),
new google.maps.LatLng(52.51108932,13.43265624),
new google.maps.LatLng(52.51042557,13.43415564),
new google.maps.LatLng(52.51003263,13.4349804),
new google.maps.LatLng(52.50925062,13.43649852),
new google.maps.LatLng(52.50921246,13.43655504),
new google.maps.LatLng(52.50917439,13.43661228),
new google.maps.LatLng(52.50909042,13.4367228),
new google.maps.LatLng(52.50893022,13.4369622),
new google.maps.LatLng(52.50839229,13.438161),
new google.maps.LatLng(52.50817494,13.4384688),
new google.maps.LatLng(52.5080223,13.43878092),
new google.maps.LatLng(52.50796128,13.43879136),
new google.maps.LatLng(52.50772476,13.43908296),
new google.maps.LatLng(52.50767895,13.4391528),
new google.maps.LatLng(52.50765231,13.43916504),
new google.maps.LatLng(52.50765231,13.43919564),
new google.maps.LatLng(52.50759507,13.43927844),
new google.maps.LatLng(52.50712968,13.43986308),
new google.maps.LatLng(52.50654981,13.44122028),
new google.maps.LatLng(52.50608829,13.44243924),
new google.maps.LatLng(52.50592422,13.4428986),
new google.maps.LatLng(52.50589371,13.44299976),
new google.maps.LatLng(52.50573729,13.4434746),
new google.maps.LatLng(52.50565719,13.44369132),
new google.maps.LatLng(52.50555036,13.44402108),
new google.maps.LatLng(52.50542454,13.44439512),
new google.maps.LatLng(52.50529863,13.44464964),
new google.maps.LatLng(52.50430296,13.44664008),
new google.maps.LatLng(52.50347136,13.44836124),
new google.maps.LatLng(52.50292587,13.44954384),
new google.maps.LatLng(52.50216672,13.4517888),
new google.maps.LatLng(52.50181194,13.45285224),
new google.maps.LatLng(52.50150684,13.45349232),
new google.maps.LatLng(52.50132369,13.453641),
new google.maps.LatLng(52.50119778,13.4536446),
new google.maps.LatLng(52.50114441,13.45356648),
new google.maps.LatLng(52.50101085,13.45383756),
new google.maps.LatLng(52.50120165,13.4540892),
new google.maps.LatLng(52.50126267,13.45440384),
new google.maps.LatLng(52.50127032,13.45477212),
new google.maps.LatLng(52.50120165,13.45496004),
new google.maps.LatLng(52.50112911,13.45498272),
new google.maps.LatLng(52.50078963,13.4555472),
new google.maps.LatLng(52.50080493,13.45566672),
new google.maps.LatLng(52.50057219,13.4561358),
new google.maps.LatLng(52.5004578,13.4561556),
new google.maps.LatLng(52.50033954,13.4561178),
new google.maps.LatLng(52.4998512,13.45681764),
new google.maps.LatLng(52.49974446,13.456233),
new google.maps.LatLng(52.49964906,13.45550436),
new google.maps.LatLng(52.49951937,13.45491792),
new google.maps.LatLng(52.49925999,13.45426272),
new google.maps.LatLng(52.49882124,13.45358088),
new google.maps.LatLng(52.49874114,13.4534844),
new google.maps.LatLng(52.49866482,13.45337568),
new google.maps.LatLng(52.49818035,13.45270644),
new google.maps.LatLng(52.49782179,13.4522496),
new google.maps.LatLng(52.49705121,13.45124628),
new google.maps.LatLng(52.49690631,13.45098384),
new google.maps.LatLng(52.49682234,13.45077144),
new google.maps.LatLng(52.49677662,13.45039848),
new google.maps.LatLng(52.49679561,13.45007628),
new google.maps.LatLng(52.49685285,13.44969648),
new google.maps.LatLng(52.49685285,13.4493426),
new google.maps.LatLng(52.49680713,13.44901356),
new google.maps.LatLng(52.49671938,13.4486532),
new google.maps.LatLng(52.49656674,13.44831552),
new google.maps.LatLng(52.49642184,13.44806964),
new google.maps.LatLng(52.49713518,13.44768336),
new google.maps.LatLng(52.50090789,13.43541708),
new google.maps.LatLng(52.50014118,13.43380932),
new google.maps.LatLng(52.50073626,13.43193732),
new google.maps.LatLng(52.50083157,13.43172168),
new google.maps.LatLng(52.50140379,13.43073384),
new google.maps.LatLng(52.50138093,13.42984572),
new google.maps.LatLng(52.50331116,13.4223948),
new google.maps.LatLng(52.50757221,13.425273),
new google.maps.LatLng(52.50756834,13.42598256),
new google.maps.LatLng(52.50765987,13.42692),
new google.maps.LatLng(52.50773241,13.42744056),
new google.maps.LatLng(52.50788496,13.42816164),
new google.maps.LatLng(52.50815586,13.42883124),
new google.maps.LatLng(52.50819393,13.4298972),
new google.maps.LatLng(52.50806424,13.43040264),
new google.maps.LatLng(52.50868227,13.43083392),
new google.maps.LatLng(52.50963591,13.43149668),
new google.maps.LatLng(52.50987243,13.43164824),
new google.maps.LatLng(52.51044843,13.43206224),
new google.maps.LatLng(52.51051332,13.43228724),
new google.maps.LatLng(52.51079556,13.43247228),
new google.maps.LatLng(52.51092912,13.432599)
];
var triangleCoords3 = [
new google.maps.LatLng(52.50757221,13.425273),
new google.maps.LatLng(52.50331116,13.4223948),
new google.maps.LatLng(52.50138093,13.42984572),
new google.maps.LatLng(52.50140379,13.43073384),
new google.maps.LatLng(52.50083157,13.43172168),
new google.maps.LatLng(52.50073626,13.43193732),
new google.maps.LatLng(52.50014118,13.43380932),
new google.maps.LatLng(52.50090789,13.43541708),
new google.maps.LatLng(52.49713518,13.44768336),
new google.maps.LatLng(52.49642184,13.44806964),
new google.maps.LatLng(52.4962044,13.44778812),
new google.maps.LatLng(52.49608992,13.4476614),
new google.maps.LatLng(52.49598696,13.44752028),
new google.maps.LatLng(52.49555208,13.44695472),
new google.maps.LatLng(52.49553678,13.44694032),
new google.maps.LatLng(52.49538036,13.44672),
new google.maps.LatLng(52.4952927,13.44661056),
new google.maps.LatLng(52.49525832,13.44656484),
new google.maps.LatLng(52.49521251,13.44650076),
new google.maps.LatLng(52.49489211,13.4460792),
new google.maps.LatLng(52.49424366,13.445217),
new google.maps.LatLng(52.49324421,13.44393144),
new google.maps.LatLng(52.49309544,13.4437122),
new google.maps.LatLng(52.49295045,13.44342132),
new google.maps.LatLng(52.49277117,13.44314196),
new google.maps.LatLng(52.49249649,13.44297312),
new google.maps.LatLng(52.49226762,13.44283884),
new google.maps.LatLng(52.49204253,13.44280608),
new google.maps.LatLng(52.49169162,13.4411706),
new google.maps.LatLng(52.49263383,13.44139092),
new google.maps.LatLng(52.49330901,13.43915568),
new google.maps.LatLng(52.49347686,13.4385948),
new google.maps.LatLng(52.49364093,13.43803104),
new google.maps.LatLng(52.49397663,13.43690604),
new google.maps.LatLng(52.49533077,13.432437),
new google.maps.LatLng(52.49801637,13.4234658),
new google.maps.LatLng(52.49816892,13.4208954),
new google.maps.LatLng(52.49756619,13.41832716),
new google.maps.LatLng(52.49768832,13.4156808),
new google.maps.LatLng(52.49997333,13.4160768),
new google.maps.LatLng(52.50085065,13.41533196),
new google.maps.LatLng(52.5017853,13.41599364),
new google.maps.LatLng(52.50184254,13.41688428),
new google.maps.LatLng(52.50181959,13.41769212),
new google.maps.LatLng(52.50358962,13.4190828),
new google.maps.LatLng(52.50369645,13.41850104),
new google.maps.LatLng(52.50393675,13.41792792),
new google.maps.LatLng(52.50460815,13.4179794),
new google.maps.LatLng(52.50478365,13.41976356),
new google.maps.LatLng(52.50612258,13.42085472),
new google.maps.LatLng(52.50625614,13.4204796),
new google.maps.LatLng(52.50632859,13.42029492),
new google.maps.LatLng(52.50671388,13.4206344),
new google.maps.LatLng(52.50680919,13.42069992),
new google.maps.LatLng(52.5069351,13.42078308),
new google.maps.LatLng(52.5071106,13.42090044),
new google.maps.LatLng(52.50723264,13.42098324),
new google.maps.LatLng(52.50741957,13.4211006),
new google.maps.LatLng(52.50738141,13.4214516),
new google.maps.LatLng(52.50749967,13.42185984),
new google.maps.LatLng(52.50754926,13.4219808),
new google.maps.LatLng(52.50806811,13.42239012),
new google.maps.LatLng(52.50796893,13.42278),
new google.maps.LatLng(52.5079269,13.42292508),
new google.maps.LatLng(52.50783537,13.4232426),
new google.maps.LatLng(52.5076866,13.42380816),
new google.maps.LatLng(52.50758364,13.4245674),
new google.maps.LatLng(52.50757221,13.425273)
];
function berechneNeu(plzArray) {
//var triangleCoords_neu = new Array();
//for(var i=0; i<plzArray.length; i++) {
// punkt = toMercator(plzArray[i].lng(),plzArray[i].lat());
// if(i<2) {
// alert(punkt);
// }
// triangleCoords_neu[i] = new
google.maps.LatLng(punkt[1],punkt[0]);
//triangleCoords_neu[i] = new
google.maps.LatLng(plzArray[i].lat(),plzArray[i].lng());
//}
//return triangleCoords_neu;
return plzArray;
}
bermudaTriangle1 = new google.maps.Polygon({
paths: berechneNeu(triangleCoords1),
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35
});
bermudaTriangle2 = new google.maps.Polygon({
paths: berechneNeu(triangleCoords2),
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF8C00",
fillOpacity: 0.35
});
bermudaTriangle3 = new google.maps.Polygon({
paths: berechneNeu(triangleCoords3),
strokeColor: "#0000FF",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35
});
bermudaTriangle1.setMap(map);
bermudaTriangle2.setMap(map);
bermudaTriangle3.setMap(map);
}
function toMercator (lon, lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI /
180);
y = y * 20037508.34 / 180;
return [x, y];
}
function inverseMercator (x, y) {
var lon = (x / 20037508.34) * 180;
var lat = (y / 20037508.34) * 180;
lat = 180/Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180)) -
Math.PI / 2);
return [lon, lat];
}
</script>
</head>
<body onload="initialize()">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
</code>
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.