diff --git a/demos/listmap/js/listmap.js b/demos/listmap/js/listmap.js index 5807ce48..eb01bf48 100644 --- a/demos/listmap/js/listmap.js +++ b/demos/listmap/js/listmap.js @@ -17,7 +17,7 @@ Ox.load('UI', { geoname: place.name, id: place.code, name: place.name, - type: 'Country', + type: 'country', lat: place.lat, lng: place.lng, south: place.south, @@ -26,6 +26,7 @@ Ox.load('UI', { east: place.east }; }), + showTypes: true, width: window.innerWidth }) .bindEvent({ diff --git a/demos/listmap2/js/listmap.js b/demos/listmap2/js/listmap.js index ce35fb09..a24168b2 100644 --- a/demos/listmap2/js/listmap.js +++ b/demos/listmap2/js/listmap.js @@ -176,6 +176,7 @@ Ox.load('Geo', function() { places.splice(i, 1); callback(); }, + //showTypes: true, width: window.innerWidth }) .bindEvent({ diff --git a/source/Ox.UI/js/Map/Ox.ListMap.js b/source/Ox.UI/js/Map/Ox.ListMap.js index 31657f06..0b8e03f0 100644 --- a/source/Ox.UI/js/Map/Ox.ListMap.js +++ b/source/Ox.UI/js/Map/Ox.ListMap.js @@ -209,7 +209,7 @@ Ox.ListMap = function(options, self) { operator: '-', title: 'Matches', visible: false, - width: 96, + width: 64, } ]; @@ -287,6 +287,7 @@ Ox.ListMap = function(options, self) { height: self.options.height, places: self.options.places, //statusbar: true, + showTypes: self.options.showTypes, toolbar: true, width: self.options.width - 514,//self.mapResize[1], zoombar: true diff --git a/source/Ox.UI/js/Map/Ox.Map.js b/source/Ox.UI/js/Map/Ox.Map.js index 47bc2d33..43b497fd 100644 --- a/source/Ox.UI/js/Map/Ox.Map.js +++ b/source/Ox.UI/js/Map/Ox.Map.js @@ -33,6 +33,7 @@ Ox.Map Basic map object selected Id of the selected place showControls If true, show controls showLabels If true, show labels on the map + showTypes If true, color markers according to place type statusbar If true, the map has a statusbar toolbar If true, the map has a toolbar self Shared private variable @@ -99,6 +100,7 @@ Ox.Map = function(options, self) { selected: null, showControls: false, showLabels: false, + showTypes: false, statusbar: false, toolbar: false, zoombar: false @@ -1009,8 +1011,7 @@ Ox.Map = function(options, self) { query: { conditions: [ {key: 'id', value: id, operator: '='} - ], - operator: '&' + ] } }, function(results) { place = new Ox.MapPlace(Ox.extend({ diff --git a/source/Ox.UI/js/Map/Ox.MapMarker.js b/source/Ox.UI/js/Map/Ox.MapMarker.js index 2078fb42..ecd8f21b 100644 --- a/source/Ox.UI/js/Map/Ox.MapMarker.js +++ b/source/Ox.UI/js/Map/Ox.MapMarker.js @@ -19,7 +19,21 @@ Ox.MapMarker = function(options) { size: 16 }, options); - var that = this; + var that = this, + typeColor = { + country: [0, 0, 255], + region: [128, 0, 255], + city: [255, 0, 0], + borough: [255, 128, 0], + street: [255, 255, 0], + premise: [128, 255, 0], + feature: [0, 255, 0], + other: [128, 128, 128] + }; + Ox.print('TYPE:', options.place.type) + if (typeColor[options.place.type]) { + options.color = typeColor[options.place.type]; + } Ox.forEach(options, function(val, key) { that[key] = val;