[MS4W-Users] MS4W-Users Digest, Vol 32, Issue 7
Kenneth Hauklien
kenneth at micado.no
Fri Mar 29 16:10:49 EDT 2019
Thanks you so much for the clarification :D
Made my day!
Hilsen
Kenneth Hauklien
kenneth at micado.no
https://www.micado.no
On Fri, Mar 29, 2019 at 7:13 PM <ms4w-users-request at lists.ms4w.com> wrote:
> Send MS4W-Users mailing list submissions to
> ms4w-users at lists.ms4w.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.ms4w.com/mailman/listinfo/ms4w-users
> or, via email, send a message with subject or body 'help' to
> ms4w-users-request at lists.ms4w.com
>
> You can reach the person managing the list at
> ms4w-users-owner at lists.ms4w.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of MS4W-Users digest..."
>
>
> Today's Topics:
>
> 1. Re: Get data values from shapeObj MapScript
> (igis at interactivegis.com)
> 2. MS4W GUI (John Stansell)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 29 Mar 2019 17:09:08 +0000
> From: "igis at interactivegis.com" <igis at interactivegis.com>
> To: ms4w-users at lists.ms4w.com
> Subject: Re: [MS4W-Users] Get data values from shapeObj MapScript
> Message-ID: <em0a07c13e-ed03-45aa-ac54-ca62d116bd99 at andrew10>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"
>
> Hi Kenneth,
>
> The example code we sent out earlier today actually helps with this as
> well. The IDs are now in the layer object, so after you get the $layer
> and get a shape using the layerObj Methods (like queryBy or nextShape or
> whatever from
> https://www.mapserver.org/mapscript/mapscript.html#layerobj-methods) you
> can use $layer->numitems there to see how many attribute fields the
> shapes have and loop over that using $layer->getItem($x) to get the
> names of those attribute fields.
>
> This should let you create an array using $layer->getItem() (which I
> called $layer_headers in my sample code) which has the same numeric
> indexes as your $shape->getValue, but the $layer->getItem() values are
> the field names, so you can use a line like this to target an attribute
> directly once you've created the $layer_headers array:
>
> $shape->getValue(array_search('Gis_ID', $layer_headers));
>
> Depending on your needs you could loop through all of $layer->getItem()
> and all of $shape->getValue() and create an array that matches them up
> since the numerical indexes would always be a match, which is more of
> what the sample code from earlier at http://bit.ly/2OxnDih does.
>
> Hope that helps!
>
>
> ------ Original Message ------
> Hi there,
>
>
> In previous versions of MapServer and MapScript (
> https://mapserver.org/mapscript/php/index-5.6.html#shapeobj), i could
> query
> a shapeObj after its values. And get a key => value array with all the data
> fields.
>
>
> Example:
>
> public function __construct(\shapeObj $shape)
>
> {
>
> foreach ($shape->values as $key => $value) {
>
> //Do something;
>
> }
>
> }
>
>
> In the new Mapserver and MapScript, there is no $shape->values attribute.
>
>
> I can get the value of element X but not the key name (Example "Gis_ID") by
> using this function:
>
>
> $shape->getValue(3);
>
>
> But this does not help my much. My map sources are dynamic and i need to
> target the data by IDs, and not a random array index.
>
>
> Can anyone help me figure this out? :)
>
> Hilsen
> Kenneth Hauklien
> kenneth at micado.no
> https://www.micado.no
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.ms4w.com/pipermail/ms4w-users/attachments/20190329/1e992f53/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Fri, 29 Mar 2019 18:12:06 +0000
> From: John Stansell <johns at g-uts.com>
> To: "ms4w-users at lists.ms4w.com" <ms4w-users at lists.ms4w.com>
> Subject: [MS4W-Users] MS4W GUI
> Message-ID:
> <
> BN8PR20MB22914BEB5687A0BE63FE0979FD5A0 at BN8PR20MB2291.namprd20.prod.outlook.com
> >
>
> Content-Type: text/plain; charset="iso-8859-1"
>
> I am sure this is a very basic question but I just can't find the answer
> and looking through MS4W and p.mapper documentation. I have an MS4W
> install that is missing the "Tools" dropdown that allows the map to be
> printed. I have tried adding init\print.php to a couple of config files
> but it seems to lock up the map when doing that.
>
> Any help would be appreciated.
>
>
>
> John Stansell
> johns at g-uts.com<mailto:johns at g-uts.com> | www.g-uts.com<
> http://www.g-uts.com/>
>
> Support Phone: 888-366-3783 (888-FONE-PVD)
>
> [cid:df7c9c8d-622f-4dcd-aea6-8ac0e68f7798]
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://lists.ms4w.com/pipermail/ms4w-users/attachments/20190329/518bf77c/attachment.html
> >
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Outlook-x5zlblnn.png
> Type: image/png
> Size: 11793 bytes
> Desc: Outlook-x5zlblnn.png
> URL: <
> https://lists.ms4w.com/pipermail/ms4w-users/attachments/20190329/518bf77c/attachment.png
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> MS4W-Users mailing list
> MS4W-Users at lists.ms4w.com
> https://lists.ms4w.com/mailman/listinfo/ms4w-users
>
>
> ------------------------------
>
> End of MS4W-Users Digest, Vol 32, Issue 7
> *****************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ms4w.com/pipermail/ms4w-users/attachments/20190329/d60fbd87/attachment.html>
More information about the MS4W-Users
mailing list