This is a common problem, so I just updated the FAQ for gwt-google-apis. http://code.google.com/p/gwt-google-apis/wiki/MapsFAQ#Why_does_my_app_throw_an_exception_in_Map.addOverlay()_when_addi
On Thu, Dec 9, 2010 at 6:00 AM, Jan <[email protected]> wrote: > Hi, > > In my Array of Lists are the Points (LatLng Objects) saved, from which > I need the first point of every List to create may marker. My markers > are saved in the array shipMarkers of type Marker, which is defined > globaly. > > > On 9 Dez., 08:50, rjcarr <[email protected]> wrote: >> I haven't looked too closely, but you are using an array of lists. >> Are you sure this is what you're intending? From your explanation it >> seems you'd need only a one dimensional data structure. >> >> On Dec 8, 7:10 am, Jan <[email protected]> wrote: >> >> > Hi Everybody, >> >> > For my actual GWT Project, i need to add markers on my map. The number >> > of markers depends, it could be 0-3 of them. I get the datas for the >> > markers out of my database and in an array. Now i created a method, >> > witch has a for loop in it. In the for loop, i create the marker and >> > add it to the map. When i run my application, it stops at the line >> > "map.addOverlay(shipMarkers[i]);" but there comes no exceptions in the >> > debugging mode, it only stops and does nothing. I found that out, >> > because i have a textbox in my UI, where i can give some messages out. >> > As soon as i remove the line map.addOverlay(), my programm runs to the >> > end and works perfectly, but without markers.. >> >> > Here is the code of the method: >> >> > private Marker[] getShipMarkersFrom(LinkedList<LatLng>[] latLng) { >> > shipMarkers = new Marker[latLng.length]; >> >> > for(int i = 0; i < latLng.length; i++) { >> > Icon iconAnimation = Icon.newInstance(baseIcon); >> > iconAnimation.setImageURL("marker_pictures/ >> > ship_marker.png"); >> > MarkerOptions optionsAnimation = >> > MarkerOptions.newInstance(); >> > optionsAnimation.setIcon(iconAnimation); >> > LatLng latLngPoint = >> > LatLng.newInstance(latLng[i].get(0).getLatitude(),latLng[i].get(0).getLongi >> > tude()); >> > shipMarkers[i]= new Marker(latLngPoint, optionsAnimation); >> >> > map.addOverlay(shipMarkers[i]); >> > } >> >> > return shipMarkers; >> >> > } >> >> > I'm searching now for more than 3 hours because of this problem. I >> > would be really happy, if anybody can help me. >> >> > Thanks and best regards. >> >> > Jan > > -- > You received this message because you are subscribed to the Google Groups > "Google Web Toolkit" 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-web-toolkit?hl=en. > > -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" 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-web-toolkit?hl=en.
