<commit_before>Ti.include("../assets/utils.js");
Ti.include("../assets/localdata.js");

var map, community = LDATA.getCommunityMembers();

if(!community){
// TODO vary this message depending on status
    Ti.UI.currentTab.open($.create({ type: "Window", url:'profileedit.js' }));
	Ti.UI.createAlertDialog({
		title: 'Join the community!',
		message: 'Before you can see the map you must fill in your data and upload it!',
	}).show();
} else {
	render();
}

function render(){
    var usercoords = LDATA.getUserData("coords") || {latitude: 59.32485, longitude: 18.0699};
	map = Titanium.Map.createView({
		mapType: Titanium.Map.STANDARD_TYPE,
		region: {
			latitude: usercoords.latitude, // 59.32485,
			longitude: usercoords.longitude, // 18.0699,
			animate: false,
			latitudeDelta: 0.04,
			longitudeDelta: 0.04
		},
		animate: false,
		regionFit: true,
		// userLocation: true,
		annotations: []
	});
	win.add(map);
	map.addEventListener("click",function(e){
        if(e.annotation && e.clicksource == "rightButton"){
            Ti.UI.currentTab.open($.create({ type: "Window", url:'profileview.js',user: community[e.annotation.guid] }));
        }
	});
Ti.API.log("Adding you!");
	map.addAnnotation(Ti.Map.createAnnotation({<commit_msg>Giving creation of new window a break to fix rendering issue<commit_after>Ti.include("../assets/utils.js");
Ti.include("../assets/localdata.js");

var map, community = LDATA.getCommunityMembers();

if(!community){
// TODO vary this message depending on status
    
	var a = Ti.UI.createAlertDialog({
		title: 'Join the community!',
		message: 'Before you can see the map you must fill in your data and upload it!',
	});
	a.addEventListener('click', function(){
		Ti.UI.currentTab.open($.create({ type: "Window", url:'profileedit.js' }));
	});
	a.show();
} else {
	render();
}

function render(){
    var usercoords = LDATA.getUserData("coords") || {latitude: 59.32485, longitude: 18.0699};
	map = Titanium.Map.createView({
		mapType: Titanium.Map.STANDARD_TYPE,
		region: {
			latitude: usercoords.latitude, // 59.32485,
			longitude: usercoords.longitude, // 18.0699,
			animate: false,
			latitudeDelta: 0.04,
			longitudeDelta: 0.04
		},
		animate: false,
		regionFit: true,
		// userLocation: true,
		annotations: []
	});
	win.add(map);
	map.addEventListener("click",function(e){
        if(e.annotation && e.clicksource == "rightButton"){
            Ti.UI.currentTab.open($.create({ type: "Window", url:'profileview.js',user: community[e.annotation.guid] }));
        }
	});
Ti.API.log("Adding you!");
	map.addAnnotation(Ti.Map.createAnnotation({
{'fraction_non_alphanumeric': 0.1721879815100154, 'fraction_numerical': 0.02465331278890601, 'mean_word_length': 4.003853564547206, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3840178', 'n_tokens_mistral': 975, 'n_tokens_neox': 865, 'n_words': 189}