[OpenLayers-Users] Javascript encoding problem??

Bart van den Eijnden bartvde at opengeo.org
Tue Apr 17 11:29:16 EDT 2012


Bob,

you are not closing the img tag? So a missing > at the end of map_legend?

Bart

-- 
Bart van den Eijnden
OpenGeo - http://opengeo.org
Expert service straight from the developers.



On Apr 17, 2012, at 5:25 PM, Bob Basques wrote:

> All,
> 
> Ok, I don't know what I'm doing wrong here, but help??  I'm trying to build a chunk of HTML code to include in the layer switcher for a legend call.  It all validates via an alert and pasting into a new browser window, but won't appear in the Layer switcher.
> 
> The "map_legend" var will not display in the switcher for some reason.   The "map_link" works just fine however.
> 
>  var map_legend = veh_id + "<br /><img src=\"http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/trails_segments_public.map?veh_id=" + veh_id + "&time_idx1=4/09/2012%206:00:00&time_idx2=4/12/2012%2015:35:00&mode=legend\"";        
> 
>  var map_link = "http://gis.ci.stpaul.mn.us/datasets/DB/SAINT_PAUL/PUBLIC_WORKS/AVL/STREETS/trails_segments_public.map?veh_id=" + veh_id + "&time_idx1=4/09/2012%206:00:00&time_idx2=4/12/2012%2015:35:00";
> 
>  //alert(map_legend);
> 
>         var mslayer_test = new OpenLayers.Layer.MapServer( map_legend, map_link,
>              {layers: '',
>               format: "image/png",
>               transparent: "true"},
>                                 
>              {singleTile: "true",
>               transitionEffect: 'resize',
>               ratio: 1}
>          );
> 
> 
> 
> Here is the interface:  http://pwultra5.ci.stpaul.mn.us/cp_tiles/OpenLayers/OL.AVL.12.report1.rlb.html?veh_id=2092  The idea is to be able to initialize things with the "veh_id=2092" for adding a layer.  I can get the overlay to work (map_link), but the legend call will not work for some reason.  The 2042 layer is hardcoded in, and I'm using it as a template right now.
> 
> This feels like an encoding problem, is there some trick I'm missing here?   The only thing I see different between the two links is the map_legend has some double-quotes in it.
> 
> Thanks
> 
> bobb
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120417/312bd335/attachment.html


More information about the Users mailing list