Hi Jody,

That's an interesting case, but unfortunately Exhibit doesn't support 
that natively right now. You'll need to add some Javascript to make that 
work. The Map view is implemented here

    
http://static.simile.mit.edu/exhibit/extensions-2.0/map/scripts/map-view.js

What you need to do is to override the _reconstruct method in it by 
adding Javascript in the web page after you include Exhibit stuff:

<script>
    var oldMapViewReconstruct = Exhibit.MapView.prototype._reconstruct;
    Exhibit.MapView.prototype._reconstruct = function() {
       oldMapViewReconstruct.call(this);

       var items = this._uiContext.getCollection().getRestrictedItems();
       var courses = 
this._uiContext.getDatabase().getObjectsUnion(items, "course");
       if (courses.contains("1")) {
          this._map.setCenter(new GLatLng(-35.407532, 173.799774));
          this._map.setZoom(10);
       } else if (courses.contains("2")) {
          this._map.setCenter(new GLatLng(-48.031101, 170.662735));
          this._map.setZoom(5);
       }
    }
</script>

David

Jody Weeks wrote:
> Hello,
>  
> I am attempting to modify the google map center and zoom level, based 
> on a specific value in a field.
>  
> Using the current examples an code example of what I have tried is below:
>  
>                         <div ex:role="view"
>                         ex:viewClass="Map"
>                         ex:label="Party"
>                         ex:latlng=".birthLatLng"
>                         *ex:if="contains(.course, 
> '1')" ex:center='-35.407532,173.799774'    ex:zoom="10"
>                         ex:elseif="contains(.course, 
> '2')" ex:center='-48.031101,170.662735'    ex:zoom="5*"
>            
>                         ex:bubbleWidth="200"
>                         ex:icon=".url"
>                         ex:shapeWidth="24"
>                         ex:shapeHeight="24"
>                         ex:colorKey=".level"
>                         ex:colorCoder="party-colors" >
>  
> In this code I am attempting to display different maps in relation to 
> the value in the .course field. This coding attempt does not work for me.
> Can anyone please advise the correct syntax for IF statements within 
> the expression.
>  
> I am new to Exhibit. Many thanks in advance.
> Jody.
> ------------------------------------------------------------------------
>
> _______________________________________________
> General mailing list
> [email protected]
> http://simile.mit.edu/mailman/listinfo/general
>   

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to