@@ -121,8 +121,6 @@ export default {
121121
122122 props: {
123123 geojson: Object ,
124- screenshotFacebook: String ,
125- screenshotTwitter: String ,
126124 geoboundsIn: Array ,
127125 predecessor: Object
128126 },
@@ -177,7 +175,6 @@ export default {
177175 this .description = this .geojson .views [0 ].spec .description ;
178176 this .legend = this .geojson .views [0 ].spec .legend ;
179177 this .sources = this .geojson .sources ;
180- this .setMetaShare ();
181178 },
182179
183180 setupMapbox () {
@@ -265,40 +262,6 @@ export default {
265262 this .layers = [];
266263 this .geobounds = [];
267264 this .map = null ;
268- this .removeMetaTags ();
269- },
270-
271- addMetaTag (property , content ) {
272- const metaTag = document .createElement (' meta' );
273- metaTag .setAttribute (' property' , property);
274- metaTag .content = content;
275- document .getElementsByTagName (' head' )[0 ].appendChild (metaTag);
276- },
277-
278- removeMetaTags () {
279- const ogTitle = document .querySelector (' [name=\' og:title\' ]' );
280- const ogDescription = document .querySelector (' [name=\' og:description\' ]' );
281- const ogUrl = document .querySelector (' [name=\' og:url\' ]' );
282- const ogImage = document .querySelector (' [name=\' og:image\' ]' );
283- const twitterImage = document .querySelector (' [name=\' twitter:image\' ]' );
284- if (ogTitle) ogTitle .remove ();
285- if (ogDescription) ogDescription .remove ();
286- if (ogUrl) ogUrl .remove ();
287- if (ogImage) ogImage .remove ();
288- if (twitterImage) twitterImage .remove ();
289- },
290-
291- setMetaShare () {
292- this .removeMetaTags ();
293- this .addMetaTag (' og:title' , this .title );
294- this .addMetaTag (' og:description' , this .description );
295- this .addMetaTag (' og:url' , ` ${ document .location .origin } /${ this .hash } ` );
296- if (this .screenshotFacebook ) {
297- this .addMetaTag (' og:image' , ` ${ document .location .origin } /media/${ this .screenshotFacebook } ` );
298- }
299- if (this .screenshotTwitter ) {
300- this .addMetaTag (' twitter:image' , ` ${ document .location .origin } /media/${ this .screenshotTwitter } ` );
301- }
302265 }
303266 }
304267};
0 commit comments