<commit_before>{#
# @license 3-clause BSD
# @link https://github.com/CaseStore/CaseStore-Core
#}

{% extends 'CaseStoreBundle::base.html.twig' %}

{% block main %}

    <ol class="breadcrumb">
        <li><a href="{{ path('case_store_project', { 'projectId':project.publicId }) }}">Project {{  project.title }}</a></li>
        <li><a href="{{  path('case_store_case_study', { 'projectId':project.publicId, 'caseStudyId':caseStudy.publicId }) }}">Case Study</a></li>
        <li class="active">Edit Locations</li>
    </ol>

    <div id="Map" style="width: 100%; height: 300px;"></div>

    <div id="AddNewWrapper" style="display:none;">
        <form action="#" method="post">
            <input type="hidden" name="action" value="add">
            <input type="hidden" name="lat" value="">
            <input type="hidden" name="lng" value="">
            <input type="submit" value="Add this location">
        </form>
    </div>

    <div id="RemoveWrapper" style="display:none;">
        <form action="#" method="post">
            <input type="hidden" name="action" value="remove">
            <input type="hidden" name="id" value="">
            <input type="submit" value="Remove this location">
        </form>
    </div>

{%  endblock %}

{% block javascript %}
    <script>
        var mapObject;
        var mapData = [];
        var addMarker;
        {%  for location in locations %}
        mapData.push({ lat: {{  location.lat}}, lng: {{  location.lng }}, id: '{{  location.publicId }}' });
        {%  endfor %}

        var addIcon = L.icon({
            iconUrl: '{% image '@CaseStoreBundle/Resources/public/images/marker-add-icon.png' %}{{ asset_url }}{% endimage %}',
            shadowUrl: '{% image '@CaseStoreBundle/Resources/public/images/marker-add-shadow.png' %}{{ asset_url }}{% endimage %}',

            iconSize:     [25, 41], // size of the icon
            shadowSize:   [41, 41], // size of the shadow
            iconAnchor:   [12, 0], // point of the icon which will correspond to marker's location
            shadowAnchor: [10, 0],  // the same for the shadow
            popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor
        });

        $( document ).ready(function() {
            mapObject = L.map('Map').setView([57.04199, -3.55957], 6);

            var mapquestUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png',
                    subDomains = ['otile1','otile2','otile3','otile4'],
                    mapquestAttrib = 'Data, imagery and map information provided by <a href="http://open.mapquest.co.uk" target="_blank">MapQuest</a>, '+
                            '<a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> and contributors';
            L.tileLayer(mapquestUrl, {maxZoom: 18, attribution: mapquestAttrib, subdomains: subDomains}).addTo(mapObject);

            for (idx in mapData) {
                var marker = L.marker([ mapData[idx].lat, mapData[idx].lng]);
                marker.addTo(mapObject);
                marker.ourId = mapData[idx].id;
                marker.on('click', onClickExistingMarker);<commit_msg>Custom icon for add location has wrong offset! closes https://github.com/CaseStore/CaseStore-Core/issues/43<commit_after>{#
# @license 3-clause BSD
# @link https://github.com/CaseStore/CaseStore-Core
#}

{% extends 'CaseStoreBundle::base.html.twig' %}

{% block main %}

    <ol class="breadcrumb">
        <li><a href="{{ path('case_store_project', { 'projectId':project.publicId }) }}">Project {{  project.title }}</a></li>
        <li><a href="{{  path('case_store_case_study', { 'projectId':project.publicId, 'caseStudyId':caseStudy.publicId }) }}">Case Study</a></li>
        <li class="active">Edit Locations</li>
    </ol>

    <div id="Map" style="width: 100%; height: 300px;"></div>

    <div id="AddNewWrapper" style="display:none;">
        <form action="#" method="post">
            <input type="hidden" name="action" value="add">
            <input type="hidden" name="lat" value="">
            <input type="hidden" name="lng" value="">
            <input type="submit" value="Add this location">
        </form>
    </div>

    <div id="RemoveWrapper" style="display:none;">
        <form action="#" method="post">
            <input type="hidden" name="action" value="remove">
            <input type="hidden" name="id" value="">
            <input type="submit" value="Remove this location">
        </form>
    </div>

{%  endblock %}

{% block javascript %}
    <script>
        var mapObject;
        var mapData = [];
        var addMarker;
        {%  for location in locations %}
        mapData.push({ lat: {{  location.lat}}, lng: {{  location.lng }}, id: '{{  location.publicId }}' });
        {%  endfor %}

        var addIcon = L.icon({
            iconUrl: '{% image '@CaseStoreBundle/Resources/public/images/marker-add-icon.png' %}{{ asset_url }}{% endimage %}',
            shadowUrl: '{% image '@CaseStoreBundle/Resources/public/images/marker-add-shadow.png' %}{{ asset_url }}{% endimage %}',

            iconSize:     [25, 41], // size of the icon
            shadowSize:   [41, 41], // size of the shadow
            iconAnchor:   [12, 41], // point of the icon which will correspond to marker's location
            shadowAnchor: [10, 41],  // the same for the shadow
            popupAnchor:  [-3, -76] // point from which the popup should open relative to the iconAnchor
        });

        $( document ).ready(function() {
            mapObject = L.map('Map').setView([57.04199, -3.55957], 6);

            var mapquestUrl = 'http://{s}.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png',
                    subDomains = ['otile1','otile2','otile3','otile4'],
                    mapquestAttrib = 'Data, imagery and map information provided by <a href="http://open.mapquest.co.uk" target="_blank">MapQuest</a>, '+
                            '<a href="http://www.openstreetmap.org/" target="_blank">OpenStreetMap</a> and contributors';
            L.tileLayer(mapquestUrl, {maxZoom: 18, attribution: mapquestAttrib, subdomains: subDomains}).addTo(mapObject);

            for (idx in mapData) {
                var marker = L.marker([ mapData[idx].lat, mapData[idx].lng]);
                marker.addTo(mapObject);
                marker.ourId = mapData[idx].id;
                marker.on('click', onClickExistingMarker);
{'fraction_non_alphanumeric': 0.17555347676956656, 'fraction_numerical': 0.015279077019020891, 'mean_word_length': 2.5286028602860284, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, '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': '5630699', 'n_tokens_mistral': 2053, 'n_tokens_neox': 1904, 'n_words': 436}