Plugin Directory

Changeset 1225836


Ignore:
Timestamp:
08/20/2015 04:56:59 AM (11 years ago)
Author:
scribblemaps
Message:

increased size of editor, fixed problems with edit.

Location:
scribble-maps
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • scribble-maps/readme.txt

    r1130088 r1225836  
    3636== Changelog ==
    3737
     38= 2.0 =
     39* Fixed sizing issue on editor
     40* Fixed editing issue
     41
    3842= 1.0 =
    3943* First Version
  • scribble-maps/trunk/css/scribblemaps.css

    r1046063 r1225836  
    66}
    77#ScribbleMap{
    8    width:600px;
     8    width:650px;
    99    height: 500px;
    1010    float: left;
     
    3131    font-weight: bold;
    3232}
     33
     34#mapTypes {
     35    position: absolute;
     36    right: 10px;
     37    bottom: 80px;
     38}
     39
     40#mapTypes select {
     41    font-family: 'Open Sans', Verdana, Arial;
     42    font-weight: bold;
     43    font-size: 14px;
     44    height: 18px;
     45    color: #333333;
     46    height: 25px;
     47
     48    margin: 0;
     49    -webkit-border-radius: 5px;
     50    -moz-border-radius: 5px;
     51    border-radius: 5px;
     52    border: 1px solid #999;
     53
     54    -webkit-touch-callout: none;
     55    -webkit-user-select: none;
     56    -khtml-user-select: none;
     57    -moz-user-select: none;
     58    -ms-user-select: none;
     59    user-select: none;
     60}
  • scribble-maps/trunk/includes/admin.php

    r1046063 r1225836  
    3737                return $item[$column_name];
    3838            case 'shortcode':
    39                 return '[scribblemaps mapid="' . $item["mapid"] . '" width="400" height="300"]';
     39                return '[scribblemaps mapid="' . $item["mapid"] . '" width="450" height="300"]';
    4040            default:
    4141                return print_r($item, true); //Show the whole array for troubleshooting purposes
     
    219219    wp_enqueue_style('scribble-map-css', SCRIBBLEMAPS_URL . 'css/scribblemaps.css');
    220220    wp_enqueue_script('scribble-map-js', '//scribblemaps.com/api/js/');
    221     wp_enqueue_script('ajax-script', SCRIBBLEMAPS_URL . 'js/script.js', array('jquery'));
     221    wp_enqueue_script('sm-layers', SCRIBBLEMAPS_URL . 'js/layers.js');
     222    wp_enqueue_script('ajax-script', SCRIBBLEMAPS_URL . 'js/script.js', array('jquery', 'sm-layers'));
    222223    wp_localize_script('ajax-script', 'ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
    223224}
     
    235236            <h2>New Scribble Map</h2>
    236237        <?php endif; ?>
    237         <div id="popup">
     238    <div id="mapTypes">
     239            <select>
     240                <option value="base">Google</option>
     241                <option value="mb">MapBox</option>
     242                <option value="sm">White Board</option>
     243                <option value="osm">Open Street Map</option>
     244                <option value="esri">ESRI</option>
     245                <option value="astral">Night Sky</option>
     246            </select>
     247        </div>        <div id="popup">
    238248            <div id="ScribbleMap"></div>
    239249        <div id="instructions">
  • scribble-maps/trunk/js/script.js

    r1046063 r1225836  
    11jQuery(document).ready(function($) {
    22
    3     var editMap = document.getElementById('scribble-edit');
    4     if (null !== editMap) {
    5         var mapId = editMap.value
     3
     4    function getUrlParameter(sParam) {
     5        var sPageURL = decodeURIComponent(window.location.search.substring(1)),
     6            sURLVariables = sPageURL.split('&'),
     7            sParameterName,
     8            i;
     9
     10        for (i = 0; i < sURLVariables.length; i++) {
     11            sParameterName = sURLVariables[i].split('=');
     12
     13            if (sParameterName[0] === sParam) {
     14                return sParameterName[1] === undefined ? true : sParameterName[1];
     15            }
     16        }
     17    };
     18
     19    var mapId = getUrlParameter('map');
     20    if (mapId != "" && mapId != null) {
    621        var sm = new ScribbleMap("ScribbleMap");
    722        sm.map.load({"id": mapId}, function(data) {
     
    1025    } else {
    1126        var sm = new scribblemaps.ScribbleMap('ScribbleMap');
     27            sm.map.createNewMap();
    1228    }
     29   
     30    function changeMapTypes(skipTypeSet) {
     31        var types = [];
     32
     33        var val = $("#mapTypes select").val();
     34
     35        if (val == "base") {
     36            types = [
     37                {
     38                    id: "hybrid",
     39                    label: "Hybrid"
     40                },
     41                {
     42                    id: "road",
     43                    label: "Road"
     44                },
     45                {
     46                    id: "satellite",
     47                    label: "Satellite"
     48                },
     49                {
     50                    id: "terrain",
     51                    label: "Terrain"
     52                }
     53            ];
     54        } else {
     55            for (var i = 0; i < smLayers[val].length; i++) {
     56                types.push({
     57                    label: smLayers[val][i].label,
     58                    id: smLayers[val][i].id
     59                });
     60            }
     61        }
     62
     63        sm.ui.setMapTypes(types);
     64
     65        if (types[0].id != sm.map.getType() && !skipTypeSet) {
     66            sm.map.setType(types[0].id);
     67        }
     68    }
     69   
     70    sm.map.addListener(scribblemaps.MapEvent.BASE_TYPE_CHANGED, function (event) {
     71            var gid = getGroupId(sm.map.getType());
     72
     73            if (gid && gid != $("#mapTypes select").val()) {
     74                if (gid == "custom") {
     75                    if ($("#mapTypes select option[value='custom']").length == 0) {
     76                        $("#mapTypes select").append($('<option>', {
     77                            value: "custom",
     78                            text: 'Custom'
     79                        }));
     80                    }
     81                }
     82                $("#mapTypes select").val(gid);
     83                $("#mapTypes select").change();
     84                updateUrl(true);
     85            }
     86        });
     87   
     88    sm.addListener("ready", function () {
     89        createLayers(sm);
     90        sm.ui.hideMenuIcon(scribblemaps.MenuType.NEW_MAP);
     91       
     92        sm.ui.addDomElement($("#mapTypes").show()[0]);
     93         $("#mapTypes select").change(function () {
     94            changeMapTypes();
     95        });
     96    });
     97   
    1398    sm.map.addListener(scribblemaps.MapEvent.MAP_SAVED, function(event) {
    1499        var mapData = sm.map.getWorkingInfo();
  • scribble-maps/trunk/readme.txt

    r1130094 r1225836  
    3939== Changelog ==
    4040
     41= 1.1 =
     42* Increased size of editor
     43* Added Other Map Types
     44* Fixed bug with editing maps
     45
    4146= 1.0 =
    4247* First Version
  • scribble-maps/trunk/scribblemap.php

    r1046063 r1225836  
    33  Plugin Name: Scribble Maps
    44  Description: Plugin create and embed Scribble Maps
    5   Version: 1.0
     5  Version: 1.1
    66  Author: Scribble Maps
    77  Author URI: http://www.scribblemaps.com/
Note: See TracChangeset for help on using the changeset viewer.