diff --git a/source/mxn.googlev3.core.js b/source/mxn.googlev3.core.js index b4a3acb..eb7a09a 100644 --- a/source/mxn.googlev3.core.js +++ b/source/mxn.googlev3.core.js @@ -57,11 +57,11 @@ Mapstraction: { myOptions.overviewMapControlOptions = {opened: true}; } } - + var map = new google.maps.Map(element, myOptions); - + var fireOnNextIdle = []; - + google.maps.event.addListener(map, 'idle', function() { var fireListCount = fireOnNextIdle.length; if (fireListCount > 0) { @@ -72,16 +72,16 @@ Mapstraction: { } } }); - + // deal with click - google.maps.event.addListener(map, 'click', function(location){ - me.click.fire({'location': - new mxn.LatLonPoint(location.latLng.lat(),location.latLng.lng()) - }); + google.maps.event.addListener(map, 'click', function(event) { + me.click.fire({'location': new mxn.LatLonPoint(event.latLng.lat(),event.latLng.lng()), + 'event' : event + }); }); // deal with zoom change - google.maps.event.addListener(map, 'zoom_changed', function(){ + google.maps.event.addListener(map, 'zoom_changed', function() { // zoom_changed fires before the zooming has finished so we // wait for the next idle event before firing our changezoom // so that method calls report the correct values diff --git a/source/mxn.googlev3.geocoder.js b/source/mxn.googlev3.geocoder.js index d0ee278..79470d3 100644 --- a/source/mxn.googlev3.geocoder.js +++ b/source/mxn.googlev3.geocoder.js @@ -14,14 +14,13 @@ Geocoder: { if (query.hasOwnProperty('lat') && query.hasOwnProperty('lon')) { geocode_request_object.latLng = query.toProprietary(this.api); } - // query is an address object - else{ + else { + // query is an address object geocode_request_object.address = [ query.street, query.locality, query.region, query.country ].join(', '); } } - - // query is an address string else { + // query is an address string geocode_request_object.address = query; } @@ -33,8 +32,7 @@ Geocoder: { geocode_callback: function(results, status){ if (status != google.maps.GeocoderStatus.OK) { this.error_callback(status); - } - + } else { var places = []; @@ -44,45 +42,49 @@ Geocoder: { // lookups; multiple values 'may' be returned but only where there is ambiguity // See https://developers.google.com/maps/documentation/geocoding/#JSON - for (i=0; i 0) { + if ((return_location.street === undefined) && (streetparts.length > 0)) { return_location.street = streetparts.join(' '); } - return_location.point = new mxn.LatLonPoint(place.geometry.location.lat(), place.geometry.location.lng()); places.push(return_location); @@ -101,4 +103,4 @@ Geocoder: { } } -}); \ No newline at end of file +}); diff --git a/source/mxn.openlayers.core.js b/source/mxn.openlayers.core.js index f3ecc28..e9308c7 100644 --- a/source/mxn.openlayers.core.js +++ b/source/mxn.openlayers.core.js @@ -66,32 +66,33 @@ mxn.register('openlayers', { displayOutsideMaxExtent: true } ); - + // deal with click map.events.register('click', map, function(evt){ var lonlat = map.getLonLatFromViewPortPx(evt.xy); var point = new mxn.LatLonPoint(); point.fromProprietary(api, lonlat); - me.click.fire({'location': point }); + me.click.fire({'location': point, + 'event' : evt}); }); // deal with zoom change map.events.register('zoomend', map, function(evt){ me.changeZoom.fire(); }); - + // deal with map movement map.events.register('moveend', map, function(evt){ me.moveendHandler(me); me.endPan.fire(); }); - + // deal with initial tile loading var loadfire = function(e) { me.load.fire(); this.events.unregister('loadend', this, loadfire); }; - + for (var layerName in this.layers) { if (this.layers.hasOwnProperty(layerName)) { if (this.layers[layerName].visibility === true) { @@ -726,7 +727,7 @@ mxn.register('openlayers', { this.popup.autoSize = true; this.popup.panMapIfOutOfView = true; this.popup.fixedRelativePosition = false; - this.popup.feature = this.propriety_marker; + this.popup.feature = this.proprietary_marker; } if (!!this.popup) { diff --git a/source/mxn.ovi.core.js b/source/mxn.ovi.core.js index 336732e..01e9a23 100644 --- a/source/mxn.ovi.core.js +++ b/source/mxn.ovi.core.js @@ -24,7 +24,8 @@ Mapstraction: { // Handle click event ovi_map.addListener('click', function(event){ coords = ovi_map.pixelToGeo(event.targetX, event.targetY); - me.click.fire({'location': new mxn.LatLonPoint(coords.latitude, coords.longitude)}); + me.click.fire({'location': new mxn.LatLonPoint(coords.latitude, coords.longitude), + 'event' : event}); }, false); // Handle endPan (via centre change) and zoom events @@ -402,7 +403,7 @@ Marker: { toProprietary: function() { var properties = {}; var self = this; - + if (this.iconAnchor) { properties.anchor = [this.iconAnchor[0], this.iconAnchor[1]]; } @@ -537,7 +538,7 @@ Polyline: { else { var polyline_options = { 'visibility' : true, - 'color' : this.color, + 'color' : (this.color + (this.opacity * 255).toString(16)), 'stroke' : 'solid', 'width' : this.width };