Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 for map file #864

Open
yogeshshejwadkar opened this issue Aug 22, 2024 · 5 comments
Open

404 for map file #864

yogeshshejwadkar opened this issue Aug 22, 2024 · 5 comments

Comments

@yogeshshejwadkar
Copy link

yogeshshejwadkar commented Aug 22, 2024

I have added one layer in mapbook and also added the shape file with map file to the data folder. In mapbook I mentioned the correct path of that map file, but still 404 error is showing.

When I open that path from my browser, it is showing the map file correctly.

Please let me know where I am doing mistake.

Also showing another error below
Uncaught TypeError: Cannot read properties of null (reading 'favorite')
at isFavorite (layer-favorite.js:38:31)
at LayerFavorite.render (layer-favorite.js:45:24)
at finishClassComponent (react-dom.development.js:18470:31)
at updateClassComponent (react-dom.development.js:18423:24)
at beginWork$1 (react-dom.development.js:20186:16)
at HTMLUnknownElement.callCallback (react-dom.development.js:336:14)
at Object.invokeGuardedCallbackDev (react-dom.development.js:385:16)
at invokeGuardedCallback (react-dom.development.js:440:31)
at beginWork$$1 (react-dom.development.js:25780:7)
at performUnitOfWork (react-dom.development.js:24695:12)

The above error occurred in the component:
in LayerFavorite (created by Connect(LayerFavorite))
in Connect(LayerFavorite) (created by CatalogLayer)
in div (created by CatalogLayer)
in div (created by CatalogLayer)
in CatalogLayer (created by Connect(CatalogLayer))
in Connect(CatalogLayer) (created by Catalog)
in div (created by CatalogGroup)
in div (created by CatalogGroup)
in CatalogGroup (created by Catalog)
in div (created by CatalogGroup)
in div (created by CatalogGroup)
in CatalogGroup (created by Catalog)
in div (created by Catalog)
in Provider (created by Catalog)
in Catalog (created by Connect(Catalog))
in Connect(Catalog)

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.

@klassenjs
Copy link
Member

It's really hard to tell based on your description what is wrong. I don't understand where a 404 would come from.

All I can say is usually the "null" errors in GeoMoose are from an error in parsing the mapbook. I wish we had better error reporting there. My guess is something is misspelled or an ID doesn't match between the catalog and map-source sections.

@yogeshshejwadkar
Copy link
Author

Below is the code
Mapbook

<map-source name="sketch" type="vector" title="Drawing and Markup">
    <layer name="default" selectable="true" status="on">
        <style><![CDATA[
        {
            "circle-radius": 4,
            "circle-color": "#fec44f",
            "fill-color": "#fec44f",
            "circle-stroke-color": "#d95f0e",
            "line-color": "#d95f0e",
            "line-width": 4,
            "fill-opacity": 0.60,
            "line-opacity": 0.80
        }
        ]]></style>

        <legend type="html"><![CDATA[
        The <b>Drawing and Markup</b> layer can be used to add user defined shapes
        to the map.<br>
        <div style='padding-top: 3px; padding-bottom: 5px;'>
            <div style='vertical-align: middle; display: inline-block; width: 2em; height: 1em; background-color: #fec44f; border: solid 2px #d95f0e;'></div>
            <b>Drawing</b>
        </div>
        ]]></legend>

        <template name="identify" auto="true" />
    </layer>
</map-source>

<!-- <map-source name="places" type="geojson" title="Cities and Villages" minresolution="100" maxresolution="5000">
    <url>./places.geojson</url>
    <layer name="default">
        <style><![CDATA[
        {
            "line-color" : "#9e8647",
            "line-width" : 5
        }
        ]]></style>
        <template name="identify" auto="true" />
    </layer>
</map-source> -->

<!-- <map-source name="wards" type="mapserver" up="true" down="true" title="Wards">
    <file>./pune/wards.map</file>
    <layer name="ward-layer" status="on">
        <template name="identify" src="./maps/templates/wards.html" />
    </layer>
</map-source>

<map-source name="mh_district" type="mapserver" up="true" down="true" title="MH-Districts">
    <file>./maharashtra/mh_district.map</file>
    <layer name="mh_district-layer" status="off">
        <template name="identify" src="./maps/templates/district.html" />
    </layer>
</map-source> -->

<map-source name="pune_district" type="mapserver" up="true" down="true" title="Pune District">
    <file>pune/pune.map</file>
    <layer name="pune_district" status="on" />
</map-source>

<map-source name="openstreetmap" type="xyz">
    <layer name="osm_mapnik" status="on">
        <attribution><![CDATA[
            &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> Contributors.
        ]]></attribution>
    </layer>
    <url>https://a.tile.openstreetmap.org/{z}/{x}/{y}.png</url>
    <url>https://b.tile.openstreetmap.org/{z}/{x}/{y}.png</url>
    <url>https://c.tile.openstreetmap.org/{z}/{x}/{y}.png</url>

    <param name="cross-origin" value="anonymous"/>
</map-source>

<!--
    The catalog defines how the layers will be displayed in the catalog tab.
-->
<catalog>
    <!-- Layer for testing international character support.
    <layer title="Test International Characters" src="international/testing"/>
    -->
    <group title="Overlays" expand="true">
        <!-- <group title="Pune" expand="true">
            <layer src="wards/ward-layer" metadata="false" legend-toggle="false" tip="Pune wards" refresh="10" />
        </group>
        <group title="Maharashtra" expand="true">
            <layer src="mh_district/mh_district-layer" metadata="false" legend-toggle="false" tip="MH Districts" refresh="10" />
        </group> -->
        <group title="Pune" expand="false">
            <layer src="pune_district" metadata="false" legend-toggle="false" tip="Pune District" refresh="10" />
        </group>
    </group>

    <group title="Backgrounds" expand="true">
        <layer title="OpenStreetMap" src="openstreetmap/osm_mapnik" legend="false" fade="true" unfade="true"/>
    </group>
</catalog>

<!--
    The toolbar defines which services are referneces in the toolbar
-->
<toolbar>
    <tool name="measure" title="Measure" type="service"/>
    <tool name="identify" title="Identify" type="service"/>
    <tool name="select" title="Select Features" type="service"/>
    <tool name="search" title="Search Parcels" type="service"/>
    <tool name="geocode" title="Geocode an Address" type="service"/>
    <tool name="findme" title="Find Me" type="action"/>
    <tool name="print" title="Print" type="action"/>
    <tool name="fullextent" title="Zoom to Full Extent" type="action"/>
    <tool name="reload" title="Reload Map" type="action"/>
</toolbar>

Map File

MAP
INCLUDE '../../map_globals.map'
CONFIG "MS_ERRORFILE" "/var/www/html/broadway/public/maps/logs/ms_error.txt"
DEBUG 1

WEB
    METADATA
        'ows_title' 'Pune District Data'
        INCLUDE '../../common_metadata.map'
        'wfs_getfeature_formatlist' 'gml,geojson'
    END
END

LAYER
    NAME pune_district
    DUMP TRUE

    METADATA
        'ows_title' 'Pune'
        'ows_include_items' 'all'
        'gml_include_items' 'all'
    END

    TYPE POLYGON
    DATA './pune.shp'
    #FILTER ([PARC_CODE] == 1)

    PROJECTION
        'init=epsg:32643'
    END

    #OPACITY 50

    #LABELITEM 'TALUKA_NAM'
    #LABELCACHE ON
    #LABELMAXSCALE 80000
    #LABELMINSCALE 3000

    CLASS
        STYLE
            SIZE 1
            WIDTH 2
            OUTLINECOLOR 55 87 153
            #MAXSCALEDENOM 15000
            COLOR 175 196 237
        END

        LABEL
            TYPE TRUETYPE
            FONT vera_sans
            SIZE 8
            #ANTIALIAS TRUE
            COLOR 0 0 0
            OUTLINECOLOR 254 254 200
            #BUFFER 4
            #MINFEATURESIZE auto
            #PARTIALS FALSE
            #POSITION cc
        END
    END

    TEMPLATE 'dummy'

END

END ## end Map

and attached are the errors I am getting
Screenshot from 2024-08-22 20-48-36

@tchaddad
Copy link
Collaborator

hi @yogeshshejwadkar I think the correction you need to make is in the Catalog section at the bottom of the mapbook.xml.

the reference to the layer source needs to be updated from:

<layer src="pune_district" ...

to:

<layer src="pune_district/pune_district" ...

@yogeshshejwadkar
Copy link
Author

yogeshshejwadkar commented Aug 22, 2024

Screenshot from 2024-08-22 22-22-58
Hi @tchaddad

This I tried before, but as per your suggestion tried again and same error

Screenshot from 2024-08-22 22-21-13

@tchaddad
Copy link
Collaborator

tchaddad commented Aug 22, 2024

From the error, It looks like the path to your mapfile in the map source is also possibly missing a folder.

<map-source name="pune_district" type="mapserver" up="true" down="true" title="Pune District">
    <file>data/pune/pune.map</file>
    <layer name="pune_district/pune_district" status="on" />
</map-source>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants