if(!isWidgetSupported(protocol)) {
return;
}
MapLocationMarkerAttributes attr = (MapLocationMarkerAttributes)attributes;
double lng = attr.getLongitude();
double lat = attr.getLatitude();
String src = attr.getSrc();
int minZoom = attr.getMinZoom();
int maxZoom = attr.getMaxZoom();
GoogleCalculator calc = GoogleCalculatorExtended.getInstance();
GPoint gPoint = calc.fromLatLngToPixel(new GLatLng(lat, lng), 0);
GImage gImage = calc.fromGPixelToGImage(gPoint);
StringBuffer textBuffer = new StringBuffer();
textBuffer.append(
createJavaScriptWidgetRegistrationOpening(
attr.getId()))
.append("new Widget.MapLocationMarker(")
.append(createJavaScriptString(attr.getId()))
.append(", {")
.append("lng: ").append(gImage.getImgX()).append(", ")
.append("lat: ").append(gImage.getImgY()).append(", ")
.append("src: ").append(createJavaScriptString(src)).append(", ")
.append("minZoom: ").append(minZoom).append(", ")
.append("maxZoom: ").append(maxZoom)
.append("})")
.append(createJavaScriptWidgetRegistrationClosure());
addCreatedWidgetId(attr.getId());
writeJavaScript(textBuffer.toString());
}